Skip to content

tests: Improve validity of binary GDBusMessage parsing tests

These tests were originally written using the output directly from a fuzzer which had triggered the bugs we’re testing for. However, that means they’re liable to no longer test what they’re intended to test if the GDBusMessage parsing code is changed to (for example) check for certain errors earlier in future.

It’s better to only have one invalidity in each binary blob, so change the test messages to all be valid apart from the specific thing they’re testing for.

The changes were based on reading the D-Bus specification directly: https://dbus.freedesktop.org/doc/dbus-specification.html

During these changes I found one problem in test_message_parse_deep_header_nesting() where it wasn’t actually nesting variants in the header deeply enough to trigger the bug it was supposed to be testing for. Fixed that.

Signed-off-by: Philip Withnall pwithnall@endlessos.org

Fixes: #1963 (closed)

Merge request reports

Loading