David Zeuthen bb6530eb34 GDBus: Fix serialization of empty arrays
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>
2010-05-14 12:56:09 -04:00
..
2010-01-12 16:34:23 +01:00
2009-11-29 22:54:16 -05:00
2010-04-20 20:13:56 -04:00
2010-02-21 15:55:10 -05:00
2009-11-29 22:54:16 -05:00
2009-03-31 19:39:16 -04:00
2009-12-01 10:44:42 +01:00
2009-11-29 22:54:16 -05:00
2009-08-19 11:02:05 +02:00
2010-03-26 09:30:25 -04:00
2009-11-29 22:54:16 -05:00
2009-11-29 22:54:16 -05:00
2009-11-29 22:54:16 -05:00
2009-11-29 22:54:16 -05:00
2010-05-14 08:38:07 -04:00
2010-05-14 08:38:07 -04:00
2010-05-10 08:07:07 -04:00
2010-05-14 08:38:07 -04:00
2010-05-09 22:13:18 -04:00
2010-05-14 08:38:07 -04:00
2010-05-14 08:38:07 -04:00
2010-05-14 08:38:07 -04:00
2010-05-13 18:04:48 -04:00
2010-05-14 08:38:07 -04:00
2010-05-14 08:38:07 -04:00
2010-05-14 08:38:07 -04:00
2010-05-08 23:28:17 -04:00
2009-12-01 10:44:42 +01:00
2009-11-29 22:54:16 -05:00
2009-06-15 00:45:55 -04:00
2009-11-17 20:27:38 -06:00
2009-10-13 16:21:42 +02:00
2010-05-08 23:28:17 -04:00
2009-06-18 15:27:42 +02:00
2009-05-13 14:42:46 +02:00
2009-12-01 10:44:42 +01:00
2010-04-21 02:32:43 +02:00
2009-09-18 19:20:06 -04:00
2010-01-12 16:34:18 +01:00
2010-05-14 08:38:07 -04:00
2010-05-13 18:04:48 -04:00
2007-12-01 23:49:34 +00:00
2010-03-26 11:05:02 -04:00
2009-09-18 19:20:06 -04:00
2009-05-13 14:42:38 +02:00
2010-05-14 00:21:39 -04:00
2009-12-01 10:44:42 +01:00
2009-11-29 22:54:16 -05:00
2010-03-08 00:12:33 -05:00
2009-12-01 10:44:42 +01:00
2009-05-28 00:30:21 -04:00
2009-11-23 16:22:52 +01:00
2009-12-01 10:44:42 +01:00
2010-04-16 23:23:40 -04:00
2010-01-24 20:50:51 -05:00
2010-05-06 17:42:09 +02:00
2010-04-23 12:31:31 -04:00
2009-06-08 15:30:28 +02:00
2009-09-07 03:14:15 -04:00
2009-11-29 22:54:16 -05:00
2010-05-08 23:28:17 -04:00
2010-05-13 23:08:34 -04:00
2010-05-08 23:28:17 -04:00
2010-05-08 23:28:17 -04:00
2010-05-08 23:28:17 -04:00
2010-05-08 23:28:17 -04:00
2009-11-29 22:54:16 -05:00
2009-11-29 22:54:16 -05:00
2008-07-21 02:19:56 +00:00
2009-07-05 22:35:55 -04:00
2009-12-01 10:44:42 +01:00
2009-09-07 03:01:02 -04:00
2009-11-29 22:54:16 -05:00
2009-11-29 22:54:16 -05:00
2010-05-13 23:08:34 -04:00
2009-05-30 15:29:23 +02:00