mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-09-20 09:16:15 +02:00
bb6530eb34
It turns out that we didn't observe padding (neither when reading nor writing) for empty arrays which (apparently) is needed according to the D-Bus spec and reference implementation. A simple test case to provoke this behavior is as follows (notice the lack of 4 bytes worth of padding at position 0x0064): Error calling dbus_message_demarshal() on this blob: org.freedesktop.DBus.Error.InvalidArgs: Message is corrupted (Alignment padding not null) 0000: 6c 01 00 01 2e 00 00 00 41 00 00 00 37 00 00 00 l.......A...7... 0010: 08 01 67 00 08 73 61 7b 73 76 7d 61 73 00 00 00 ..g..sa{sv}as... 0020: 01 01 6f 00 08 00 00 00 2f 66 6f 6f 2f 62 61 72 ..o...../foo/bar 0030: 00 00 00 00 00 00 00 00 03 01 73 00 06 00 00 00 ..........s..... 0040: 4d 65 6d 62 65 72 00 00 11 00 00 00 30 31 32 33 Member......0123 0050: 34 35 36 37 38 39 30 31 32 33 34 35 36 00 00 00 4567890123456... 0060: 00 00 00 00 0e 00 00 00 09 00 00 00 53 6f 6d 65 ............Some 0070: 74 68 69 6e 67 00 thing. The blob was generated from the following GVariant value: ('01234567890123456', @a{sv} {}, ['Something']) If the blob was encoded using DBusMessageIter, the payload would have been: 0000: 6c 01 00 01 32 00 00 00 41 00 00 00 36 00 00 00 l...2...A...6... 0010: 01 01 6f 00 08 00 00 00 2f 66 6f 6f 2f 62 61 72 ..o...../foo/bar 0020: 00 00 00 00 00 00 00 00 03 01 73 00 06 00 00 00 ..........s..... 0030: 4d 65 6d 62 65 72 00 00 08 01 67 00 08 73 61 7b Member....g..sa{ 0040: 73 76 7d 61 73 00 00 00 11 00 00 00 30 31 32 33 sv}as.......0123 0050: 34 35 36 37 38 39 30 31 32 33 34 35 36 00 00 00 4567890123456... 0060: 00 00 00 00 00 00 00 00 0e 00 00 00 09 00 00 00 ................ 0070: 53 6f 6d 65 74 68 69 6e 67 00 Something. ** ERROR:gdbus-serialization.c:547:check_serialization: code should not be reached Aborted and this is now in the libdbus-1-using serialization test case. Signed-off-by: David Zeuthen <davidz@redhat.com> |
||
---|---|---|
.. | ||
schema-tests | ||
.gitignore | ||
async-close-output-stream.c | ||
buffered-input-stream.c | ||
contexts.c | ||
converter-stream.c | ||
data-input-stream.c | ||
data-output-stream.c | ||
de.po | ||
desktop-app-info.c | ||
echo-server.c | ||
filter-cat.c | ||
filter-streams.c | ||
g-file-info.c | ||
g-file.c | ||
g-icon.c | ||
gdbus-addresses.c | ||
gdbus-connection.c | ||
gdbus-error.c | ||
gdbus-example-export.c | ||
gdbus-example-own-name.c | ||
gdbus-example-peer.c | ||
gdbus-example-proxy-subclass.c | ||
gdbus-example-server.c | ||
gdbus-example-subtree.c | ||
gdbus-example-unix-fd-client.c | ||
gdbus-example-watch-name.c | ||
gdbus-example-watch-proxy.c | ||
gdbus-exit-on-close.c | ||
gdbus-export.c | ||
gdbus-introspection.c | ||
gdbus-names.c | ||
gdbus-peer.c | ||
gdbus-proxy.c | ||
gdbus-serialization.c | ||
gdbus-sessionbus.c | ||
gdbus-sessionbus.h | ||
gdbus-tests.c | ||
gdbus-tests.h | ||
gdbus-testserver.py | ||
gdbus-threading.c | ||
gschema-compile.c | ||
gsettings.c | ||
httpd.c | ||
live-g-file.c | ||
live-g-file.txt | ||
Makefile.am | ||
memory-input-stream.c | ||
memory-output-stream.c | ||
org.gtk.test.gschema | ||
org.gtk.test.gschema.xml | ||
readwrite.c | ||
resolver.c | ||
send-data.c | ||
simple-async-result.c | ||
sleepy-stream.c | ||
socket-client.c | ||
socket-common.c | ||
socket-server.c | ||
srvtarget.c | ||
unix-fd.c | ||
unix-streams.c | ||
win32-streams.c |