From 5f04cd07457352655e91d874558faba70e566979 Mon Sep 17 00:00:00 2001 From: Adrian Szyndela Date: Wed, 10 Aug 2016 14:03:09 +0200 Subject: [PATCH] Bugfix: removed double-stripping of parentheses GVariant keeps body inside structs. This fact is kept hidden from libdbus user. Thus, struct parentheses have to be added, removed in proper places. There was one such place in _dbus_type_reader_gvariant_init(). However, it was not sufficient and get_const_signature() also got stripping code. Unfortunately, I didn't notice that stripping should be removed in the first of these functions. This commit fixes that. Change-Id: I5c2e6c7c8212d283fd6da1cc998a2711038905f3 --- dbus/dbus-marshal-gvariant.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/dbus/dbus-marshal-gvariant.c b/dbus/dbus-marshal-gvariant.c index 071598a..ef0f88b 100644 --- a/dbus/dbus-marshal-gvariant.c +++ b/dbus/dbus-marshal-gvariant.c @@ -1402,13 +1402,9 @@ _dbus_type_reader_gvariant_init (DBusTypeReader *reader, DBusMessage *message) { reader->gvariant = TRUE; - /* GVariant wraps contents into struct */ - if (_dbus_string_get_byte (reader->type_str, reader->type_pos) == DBUS_STRUCT_BEGIN_CHAR) - { - reader->type_pos++; - if (_dbus_string_get_byte (reader->type_str, reader->type_pos) == DBUS_STRUCT_END_CHAR) - reader->finished = TRUE; - } + /* GVariant wraps contents into struct, but in this place type is already + * stripped off the parentheses (see get_const_signature()). + */ reader->value_end = _dbus_message_gvariant_get_body_length (message); reader->n_offsets = _dbus_reader_count_offsets (reader); -- 2.7.4