diff options
| author | Olivier Andrieu <oliv__a@users.sourceforge.net> | 2004-03-12 14:18:35 +0000 | 
|---|---|---|
| committer | Olivier Andrieu <oliv__a@users.sourceforge.net> | 2004-03-12 14:18:35 +0000 | 
| commit | 24ffe79c80d376b058c2d154b2b5f0ef8fee1c36 (patch) | |
| tree | 41461551b5a0826ded6fc569785dec2b8785fff1 | |
| parent | 520bdf704d2ff845b9e4cb91c8262245767f340a (diff) | |
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).
| -rw-r--r-- | ChangeLog | 8 | ||||
| -rw-r--r-- | dbus/dbus-marshal.c | 2 | ||||
| -rw-r--r-- | dbus/dbus-message.c | 8 | 
3 files changed, 17 insertions, 1 deletions
@@ -1,3 +1,11 @@ +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). +  2004-03-12  Mikael Hallendal  <micke@imendio.com>  	* bus/activation.c: diff --git a/dbus/dbus-marshal.c b/dbus/dbus-marshal.c index 9f92f91b..e19e36bb 100644 --- a/dbus/dbus-marshal.c +++ b/dbus/dbus-marshal.c @@ -1649,7 +1649,7 @@ _dbus_marshal_get_arg_end_pos (const DBusString *str,  	/* 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); diff --git a/dbus/dbus-message.c b/dbus/dbus-message.c index 1c7ebf24..ffaef43c 100644 --- a/dbus/dbus-message.c +++ b/dbus/dbus-message.c @@ -6003,6 +6003,12 @@ message_iter_test (DBusMessage *message)    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_test (const char *test_data_dir)    dbus_message_iter_append_custom (&iter, "MyTypeName",                                     "data", 5); +  dbus_message_iter_append_byte (&iter, 0xF0); +    message_iter_test (message);    /* Message loader test */  | 
