[patch] Fix open_container for structs and dict_entries

John (J5) Palmieri johnp at redhat.com
Wed Feb 9 16:19:43 PST 2005

There are two bugs in dbus_message_iter_open_container that prevents the
creation of DICT_ENTRY and STRUCT types.

The first one which only affects DICT_ENTRY is an assert to check that
the DICT_ENTRY is being added to an ARRAY iterator.  However since the
ARRAY iterator is a WRITABLE iterator get_arg_type asserts.  Havoc just
told me to take that check out.

The second problem has to do with the fact that the signature is passed
to the marshaler as a dbus_string.  dbus_strings assert when being
initialized with a NULL.  Since the API calls for a NULL to be passed
into open_container when constructing a STRUCT or DICT_ENTRY the
dbus_string asserts.  I fixed this by initializing the dbus_string to an
empty string "" since the marshaler ignores this value for DICT_ENTRY
and STRUCT.  However the marshaler has a comment that it may be used in
the future so I am sure this is not the right fix and is only a bandaid.
Any suggestions on the best way to fix this?  The patch is attached.  

John (J5) Palmieri
Associate Software Engineer
Desktop Group
Red Hat, Inc.
Blog: http://martianrock.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dbus-message-open-container-fix.patch
Type: text/x-patch
Size: 1171 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/dbus/attachments/20050209/27e31fb2/dbus-message-open-container-fix.bin

More information about the dbus mailing list