Ryan Bryngelson - 2013-12-15

I found the same problem. After some investigation I found this to be the offending call (src/message.c:349):

  dbus_message_iter_open_container
  (
    (DBusMessageIter *) & (to._iter),
    from.type(),
    from.type() == DBUS_TYPE_VARIANT ? NULL : sig,
    (DBusMessageIter *) & (to_container._iter)
  );

The function 'dbus_message_iter_open_container' is from libdbus. Its documentation says the following in regards to the third parameter, contained_signature:

Container types are for example struct, variant, and array. For variants, the contained_signature should be the type of the single value inside the variant. For structs and dict entries, contained_signature should be NULL; it will be set to whatever types you write into the struct. For arrays, contained_signature should be the type of the array elements.

Simply put, variants should pass their contained type, structs and dict_entries should pass NULL, and arrays should pass the type of their elements.

I modified the call to look like this:

  dbus_message_iter_open_container
  (
    (DBusMessageIter *) & (to._iter),
    from.type(),
    ( ( from.type() == DBUS_TYPE_STRUCT ) ||
      ( from.type() == DBUS_TYPE_DICT_ENTRY ) ) ? NULL : sig,
    (DBusMessageIter *) & (to_container._iter)
  );

So structs and dict_entry types will pass NULL, otherwise the contained signature is passed.

Attached is a patch.

Ryan

 
Last edit: Ryan Bryngelson 2013-12-15