From dd8b1b1d654c983ccc040b59143a11f239de0726 Mon Sep 17 00:00:00 2001 From: Olivier Andrieu Date: Wed, 21 Apr 2004 21:29:07 +0000 Subject: * dbus/dbus-message.c (decode_header_data, decode_string_field): fix incorrect setting of .name_offset in the HeaderField (it was off by two bytes, positioned right after the name and typecode) * bus/bus.c (bus_context_new, bus_context_unref): test before calling dbus_server_free_data_slot and _dbus_user_database_unref in case of an error. * tools/Makefile.am: add $(DBUS_GLIB_TOOL_LIBS), xml libs needed by libdbus-gtool. --- dbus/dbus-message.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'dbus/dbus-message.c') diff --git a/dbus/dbus-message.c b/dbus/dbus-message.c index 322e5d0b..9066843f 100644 --- a/dbus/dbus-message.c +++ b/dbus/dbus-message.c @@ -5018,7 +5018,7 @@ decode_string_field (const DBusString *data, _dbus_string_init_const (field_data, _dbus_string_get_const_data (data) + string_data_pos); - header_field->name_offset = pos; + header_field->name_offset = pos - 2; header_field->value_offset = _DBUS_ALIGN_VALUE (pos, 4); #if 0 @@ -5188,7 +5188,7 @@ decode_header_data (const DBusString *data, return FALSE; } - fields[field].name_offset = pos; + fields[field].name_offset = pos - 2; fields[field].value_offset = _DBUS_ALIGN_VALUE (pos, 4); /* No forging signals from the local path */ @@ -5222,7 +5222,7 @@ decode_header_data (const DBusString *data, return FALSE; } - fields[field].name_offset = pos; + fields[field].name_offset = pos - 2; fields[field].value_offset = _DBUS_ALIGN_VALUE (pos, 4); _dbus_verbose ("Found reply serial %u at offset %d\n", -- cgit