Problems with named types

Andy Hanton andyhanton@comcast.net
22 Jul 2003 00:18:37 -0400


--=-7lh+A5TFDP8LzBAD4vko
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

I am trying to write a program using dbus and I'm having problems with
the named type.  dbus_message_iter_get_named fails it the length of the
type name is one less than a multiple of four.
dbus_message_iter_get_named adds one to the offset that is returned by
_dbus_demarshal_string, causing _dbus_demarshal_byte_array to round the
offset up unnecessarily and read the length of the array from the wrong
location. 
-- 
Andy Hanton <andyhanton@comcast.net>

--=-7lh+A5TFDP8LzBAD4vko
Content-Disposition: attachment; filename=named_type.patch
Content-Type: text/plain; name=named_type.patch; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

? named_type.patch
Index: dbus/dbus-message.c
===================================================================
RCS file: /freedesktop/dbus/dbus/dbus-message.c,v
retrieving revision 1.102
diff -u -r1.102 dbus-message.c
--- dbus/dbus-message.c	28 Jun 2003 23:08:14 -0000	1.102
+++ dbus/dbus-message.c	22 Jul 2003 04:16:51 -0000
@@ -2135,7 +2135,7 @@
     return FALSE;
   
   if (!_dbus_demarshal_byte_array (&real->message->body, real->message->byte_order,
-				   pos + 1, NULL, value, len))
+				   pos, NULL, value, len))
     {
       dbus_free (_name);
       return FALSE;

--=-7lh+A5TFDP8LzBAD4vko--