Commit 54eabbe8 authored by Ralf Habacker's avatar Ralf Habacker

* dbus/dbus-address.c (dbus_parse_address): Do not accept zero-length address.

* dbus/dbus-address.c (_dbus_address_test): Add test for zero-length address.
parent 37187303
2007-04-03 Timo Hoenig <thoenig@suse.de>
* dbus/dbus-address.c (dbus_parse_address): Do not accept zero-
length address.
* dbus/dbus-address.c (_dbus_address_test): Add test for zero-
length address.
2007-03-25 Ralf.Habacker <ralf.habacker@freenet.de>
* cmake/dbus/CMakeLists.txt: debug postfix also for mingw.
......
......@@ -376,6 +376,13 @@ dbus_parse_address (const char *address,
entries = NULL;
pos = 0;
len = _dbus_string_get_length (&str);
if (len == 0)
{
dbus_set_error (error, DBUS_ERROR_BAD_ADDRESS,
"Empty address '%s'", address);
goto error;
}
while (pos < len)
{
......@@ -768,6 +775,11 @@ _dbus_address_test (void)
dbus_address_entries_free (entries);
/* Different possible errors */
if (dbus_parse_address ("", &entries, &len, &error))
_dbus_assert_not_reached ("Parsed incorrect address.");
else
dbus_error_free (&error);
if (dbus_parse_address ("foo", &entries, &len, &error))
_dbus_assert_not_reached ("Parsed incorrect address.");
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment