From c0bfcc097896fb57a96f55818fc5fe97db679cbf Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 12 Sep 2022 13:28:29 +0100 Subject: [PATCH] test/data: Add messages that reproduce dbus/dbus#413, dbus/dbus#418 In debug builds with "embedded tests" enabled, these will automatically be used as input for the message-internals test. Some of the messages themselves are output from a fuzzer, others are simplifications to include only one reason for lack of validity per message. I've included an annotated hex-dump for each message here, but the dbus test suite doesn't currently know how to convert hex to binary, so I've also committed the corresponding binary. See the comment at the top of each hex-dump for how to create the binary version (which requires the xxd tool shipped with vim). It would be nice for the dbus test suite to be able to convert the annotated hex-dump to binary, either at build-time with a Python script or at runtime by loading the text file and decoding the hex, but I don't want to block on that for dbus/dbus#413 and dbus/dbus#418. Reproduces: https://gitlab.freedesktop.org/dbus/dbus/-/issues/413 Reproduces: https://gitlab.freedesktop.org/dbus/dbus/-/issues/418 Signed-off-by: Simon McVittie (cherry picked from commit d633016f7340f83142f19f4bcac08c57e1f2fd2f) [backport to 1.14.x: discard Meson build system updates] --- test/Makefile.am | 10 ++++ .../fixed-array-not-divisible.message-raw | Bin 0 -> 296 bytes .../fixed-array-not-divisible.message-raw.hex | 55 ++++++++++++++++++ .../invalid-messages/issue418.message-raw | Bin 0 -> 68 bytes .../invalid-messages/issue418.message-raw.hex | 47 +++++++++++++++ .../mis-nested-sig.message-raw | Bin 0 -> 40 bytes .../mis-nested-sig.message-raw.hex | 26 +++++++++ .../truncated-variant-sig.message-raw | Bin 0 -> 24 bytes .../truncated-variant-sig.message-raw.hex | 23 ++++++++ .../zero-length-variant-sig.message-raw | Bin 0 -> 24 bytes .../zero-length-variant-sig.message-raw.hex | 23 ++++++++ 11 files changed, 184 insertions(+) create mode 100644 test/data/invalid-messages/fixed-array-not-divisible.message-raw create mode 100644 test/data/invalid-messages/fixed-array-not-divisible.message-raw.hex create mode 100644 test/data/invalid-messages/issue418.message-raw create mode 100644 test/data/invalid-messages/issue418.message-raw.hex create mode 100644 test/data/invalid-messages/mis-nested-sig.message-raw create mode 100644 test/data/invalid-messages/mis-nested-sig.message-raw.hex create mode 100644 test/data/invalid-messages/truncated-variant-sig.message-raw create mode 100644 test/data/invalid-messages/truncated-variant-sig.message-raw.hex create mode 100644 test/data/invalid-messages/zero-length-variant-sig.message-raw create mode 100644 test/data/invalid-messages/zero-length-variant-sig.message-raw.hex diff --git a/test/Makefile.am b/test/Makefile.am index b539524c..f9d63965 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -689,6 +689,16 @@ static_data = \ data/invalid-config-files/send-and-receive.conf \ data/invalid-config-files/unknown-limit.conf \ data/invalid-messages/boolean-has-no-value.message-raw \ + data/invalid-messages/fixed-array-not-divisible.message-raw \ + data/invalid-messages/fixed-array-not-divisible.message-raw.hex \ + data/invalid-messages/issue418.message-raw \ + data/invalid-messages/issue418.message-raw.hex \ + data/invalid-messages/mis-nested-sig.message-raw \ + data/invalid-messages/mis-nested-sig.message-raw.hex \ + data/invalid-messages/truncated-variant-sig.message-raw \ + data/invalid-messages/truncated-variant-sig.message-raw.hex \ + data/invalid-messages/zero-length-variant-sig.message-raw \ + data/invalid-messages/zero-length-variant-sig.message-raw.hex \ data/sha-1/Readme.txt \ data/sha-1/bit-hashes.sha1 \ data/sha-1/bit-messages.sha1 \ diff --git a/test/data/invalid-messages/fixed-array-not-divisible.message-raw b/test/data/invalid-messages/fixed-array-not-divisible.message-raw new file mode 100644 index 0000000000000000000000000000000000000000..d7de929d6ce28c35f33675c24a4c60b1a0f3045f GIT binary patch literal 296 zcmd0C_|M1y1m74U?@It#L4t`Ii5itqpjnw%qRGGj6u$vd1O$xvu~0@BlS@%*YD#Kx zHUon=NV~%Q|C}oY6BU5k3o99JIK9-*FG>fhP=Epk7z2skz@P##?%DnO_d(*R5H8WA zMrmdHfAy^|Zvx#IXW(54bf9i*x=VhM3)poG;;GriAkY1Wx$JM