Bug 17803: Panic from dbus_signature_validate
authorColin Walters <walters@verbum.org>
Wed, 1 Oct 2008 17:49:48 +0000 (13:49 -0400)
committerColin Walters <walters@verbum.org>
Wed, 1 Oct 2008 19:00:39 +0000 (15:00 -0400)
* dbus/dbus-marshal-validate.c: Ensure we validate
a basic type before calling is_basic on it.
* dbus-marshal-validate-util.c: Test.

dbus/dbus-marshal-validate-util.c
dbus/dbus-marshal-validate.c

index f2901d7..5365d6d 100644 (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 */
index e63a463..b24b5bc 100644 (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;