Bug 17803: Panic from dbus_signature_validate

* dbus/dbus-marshal-validate.c: Ensure we validate
	a basic type before calling is_basic on it.
	* dbus-marshal-validate-util.c: Test.
This commit is contained in:
Colin Walters 2008-10-01 13:49:48 -04:00
parent 008bca5a4e
commit f2922ce4bc
2 changed files with 2 additions and 0 deletions

View file

@ -228,6 +228,7 @@ _dbus_marshal_validate_test (void)
"123",
".",
"("
"a{(ii)i}" /* https://bugs.freedesktop.org/show_bug.cgi?id=17803 */
};
/* Signature with reason */

View file

@ -247,6 +247,7 @@ _dbus_validate_signature_with_reason (const DBusString *type_str,
}
if (last == DBUS_DICT_ENTRY_BEGIN_CHAR &&
_dbus_type_is_valid (*p) &&
!dbus_type_is_basic (*p))
{
result = DBUS_INVALID_DICT_KEY_MUST_BE_BASIC_TYPE;