summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2003-05-03 23:20:34 +0000
committerHavoc Pennington <hp@redhat.com>2003-05-03 23:20:34 +0000
commitf60d798c5001070718407febeac42b63ddac314f (patch)
tree670d408913be3bf59e0076a575695d2d90c09dd2
parentf548adbae00d50d3fe034e6dacc57640ac9d366d (diff)
2003-05-03 Havoc Pennington <hp@redhat.com>
* dbus/dbus-address.c (dbus_parse_address): fix bug when a key in the address had no value, and add to test suite. Fix and regression test from Miloslav Trmac
-rw-r--r--ChangeLog6
-rw-r--r--dbus/dbus-address.c11
2 files changed, 14 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index d784240b..d13a78d3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2003-05-03 Havoc Pennington <hp@redhat.com>
+
+ * dbus/dbus-address.c (dbus_parse_address): fix bug when a key in
+ the address had no value, and add to test suite. Fix and
+ regression test from Miloslav Trmac
+
2003-05-03 Havoc Pennington <hp@pobox.com>
* bus/Makefile.am, bus/dbus-daemon-1.1.in: man page for the
diff --git a/dbus/dbus-address.c b/dbus/dbus-address.c
index d3099222..bf9dbc3b 100644
--- a/dbus/dbus-address.c
+++ b/dbus/dbus-address.c
@@ -232,8 +232,8 @@ dbus_parse_address (const char *address,
if (!_dbus_string_find_to (&str, pos, end_pos, ",", &comma_pos))
comma_pos = end_pos;
- if (!_dbus_string_find (&str, pos, "=", &equals_pos) ||
- equals_pos == pos || equals_pos + 1 == end_pos)
+ if (!_dbus_string_find_to (&str, pos, comma_pos, "=", &equals_pos) ||
+ equals_pos == pos || equals_pos + 1 == comma_pos)
{
dbus_set_error (error, DBUS_ERROR_BAD_ADDRESS,
"'=' character not found or has no value following it");
@@ -430,7 +430,12 @@ _dbus_address_test (void)
_dbus_assert_not_reached ("Parsed incorrect address.");
else
dbus_error_free (&error);
-
+
+ if (dbus_parse_address ("foo:foo,bar=baz", &entries, &len, &error))
+ _dbus_assert_not_reached ("Parsed incorrect address.");
+ else
+ dbus_error_free (&error);
+
return TRUE;
}