dbus/dbus dbus-message.c,1.119,1.120 dbus-marshal.c,1.47,1.48

Olivier Andrieu oandrieu@pdx.freedesktop.org
Fri Mar 12 14:18:37 PST 2004


Update of /cvs/dbus/dbus/dbus
In directory pdx:/tmp/cvs-serv29680/dbus

Modified Files:
	dbus-message.c dbus-marshal.c 
Log Message:
2004-03-12  Olivier Andrieu  <oliv__a@users.sourceforge.net>

	* dbus/dbus-marshal.c (_dbus_marshal_get_arg_end_pos):
	fix a bug with CUSTOM types.

	* dbus/dbus-message.c (message_iter_test, _dbus_message_test): add
	a unit test for this bug (used to fail).


Index: dbus-message.c
===================================================================
RCS file: /cvs/dbus/dbus/dbus/dbus-message.c,v
retrieving revision 1.119
retrieving revision 1.120
diff -u -d -r1.119 -r1.120
--- a/dbus-message.c	8 Mar 2004 10:29:16 -0000	1.119
+++ b/dbus-message.c	12 Mar 2004 14:18:34 -0000	1.120
@@ -6003,6 +6003,12 @@
   dbus_free (str);
   dbus_free (data);
   
+  if (!dbus_message_iter_next (&iter))
+    _dbus_assert_not_reached ("Reached end of arguments");
+
+  if (dbus_message_iter_get_byte (&iter) != 0xF0)
+    _dbus_assert_not_reached ("wrong value after custom");
+
   if (dbus_message_iter_next (&iter))
     _dbus_assert_not_reached ("Didn't reach end of arguments");
 }
@@ -7140,6 +7146,8 @@
   dbus_message_iter_append_custom (&iter, "MyTypeName",
                                    "data", 5);
   
+  dbus_message_iter_append_byte (&iter, 0xF0);
+
   message_iter_test (message);
   
   /* Message loader test */

Index: dbus-marshal.c
===================================================================
RCS file: /cvs/dbus/dbus/dbus/dbus-marshal.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -d -r1.47 -r1.48
--- a/dbus-marshal.c	2 Dec 2003 10:44:21 -0000	1.47
+++ b/dbus-marshal.c	12 Mar 2004 14:18:35 -0000	1.48
@@ -1649,7 +1649,7 @@
 	/* Demarshal the string length */
 	len = _dbus_demarshal_uint32 (str, byte_order, pos, &pos);
 
-	*end_pos = pos + len + 1;
+	pos += len + 1;
 	
 	/* Demarshal the data length */
 	len = _dbus_demarshal_uint32 (str, byte_order, pos, &pos);





More information about the dbus-commit mailing list