Bugfix: removed double-stripping of parentheses 95/83395/1
authorAdrian Szyndela <adrian.s@samsung.com>
Wed, 10 Aug 2016 12:03:09 +0000 (14:03 +0200)
committerAdrian Szyndela <adrian.s@samsung.com>
Wed, 10 Aug 2016 12:07:40 +0000 (14:07 +0200)
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

index 071598a..ef0f88b 100644 (file)
@@ -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);