dbus/dbus dbus-marshal-validate-util.c, 1.3, 1.4 dbus-marshal-validate.c, 1.17, 1.18 dbus-marshal-validate.h, 1.10, 1.11 dbus-message-factory.c, 1.6, 1.7 dbus-test.c, 1.39, 1.40

Havoc Pennington hp at freedesktop.org
Thu Feb 10 17:13:47 PST 2005


Update of /cvs/dbus/dbus/dbus
In directory gabe:/tmp/cvs-serv32703/dbus

Modified Files:
	dbus-marshal-validate-util.c dbus-marshal-validate.c 
	dbus-marshal-validate.h dbus-message-factory.c dbus-test.c 
Log Message:
2005-02-10  Havoc Pennington  <hp at redhat.com>

	* dbus/dbus-message-factory.c (generate_special): modify test to
	avoid using a non-basic dict key

	* dbus/dbus-marshal-validate-util.c: add test for the below

	* doc/dbus-specification.xml: require that dict keys are a basic
	type

	* dbus/dbus-marshal-validate.c
	(_dbus_validate_signature_with_reason): require that dict key is a
	basic type



Index: dbus-marshal-validate-util.c
===================================================================
RCS file: /cvs/dbus/dbus/dbus/dbus-marshal-validate-util.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- dbus-marshal-validate-util.c	5 Feb 2005 21:03:28 -0000	1.3
+++ dbus-marshal-validate-util.c	11 Feb 2005 01:13:45 -0000	1.4
@@ -92,7 +92,8 @@
   { "()i", DBUS_INVALID_STRUCT_HAS_NO_FIELDS },
   { "(a)", DBUS_INVALID_MISSING_ARRAY_ELEMENT_TYPE },
   { "a{ia}", DBUS_INVALID_MISSING_ARRAY_ELEMENT_TYPE },
-  { "a{}", DBUS_INVALID_DICT_ENTRY_HAS_NO_FIELDS }
+  { "a{}", DBUS_INVALID_DICT_ENTRY_HAS_NO_FIELDS },
+  { "a{aii}", DBUS_INVALID_DICT_KEY_MUST_BE_BASIC_TYPE },
   /* { "a{i}", DBUS_INVALID_DICT_ENTRY_HAS_ONLY_ONE_FIELD }, */
   /* { "{is}", DBUS_INVALID_DICT_ENTRY_NOT_INSIDE_ARRAY }, */
   /* { "a{isi}", DBUS_INVALID_DICT_ENTRY_HAS_TOO_MANY_FIELDS }, */

Index: dbus-marshal-validate.c
===================================================================
RCS file: /cvs/dbus/dbus/dbus/dbus-marshal-validate.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- dbus-marshal-validate.c	6 Feb 2005 05:19:50 -0000	1.17
+++ dbus-marshal-validate.c	11 Feb 2005 01:13:45 -0000	1.18
@@ -155,6 +155,10 @@
             array_depth = 0;
         }
 
+      if (last == DBUS_DICT_ENTRY_BEGIN_CHAR &&
+          !_dbus_type_is_basic (*p))
+        return DBUS_INVALID_DICT_KEY_MUST_BE_BASIC_TYPE;
+      
       last = *p;
       ++p;
     }

Index: dbus-marshal-validate.h
===================================================================
RCS file: /cvs/dbus/dbus/dbus/dbus-marshal-validate.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- dbus-marshal-validate.h	6 Feb 2005 05:19:50 -0000	1.10
+++ dbus-marshal-validate.h	11 Feb 2005 01:13:45 -0000	1.11
@@ -109,6 +109,7 @@
   DBUS_INVALID_DICT_ENTRY_HAS_ONLY_ONE_FIELD = 52,
   DBUS_INVALID_DICT_ENTRY_HAS_TOO_MANY_FIELDS = 53,
   DBUS_INVALID_DICT_ENTRY_NOT_INSIDE_ARRAY = 54,
+  DBUS_INVALID_DICT_KEY_MUST_BE_BASIC_TYPE = 55,
   DBUS_VALIDITY_LAST
 } DBusValidity;
 

Index: dbus-message-factory.c
===================================================================
RCS file: /cvs/dbus/dbus/dbus/dbus-message-factory.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- dbus-message-factory.c	6 Feb 2005 05:19:50 -0000	1.6
+++ dbus-message-factory.c	11 Feb 2005 01:13:45 -0000	1.7
@@ -623,7 +623,7 @@
     }
   else if (item_seq == 16)
     {
-      char long_sig[DBUS_MAXIMUM_TYPE_RECURSION_DEPTH*3+6];
+      char long_sig[DBUS_MAXIMUM_TYPE_RECURSION_DEPTH*4+8];
       const char *v_STRING;
       int i;
       int n_begins;
@@ -637,19 +637,19 @@
         _dbus_assert_not_reached ("oom");
 
       i = 0;
-      while (i <= (DBUS_MAXIMUM_TYPE_RECURSION_DEPTH*2 + 2))
+      while (i <= (DBUS_MAXIMUM_TYPE_RECURSION_DEPTH*3 + 3))
         {
           long_sig[i] = DBUS_TYPE_ARRAY;
           ++i;
           long_sig[i] = DBUS_DICT_ENTRY_BEGIN_CHAR;
           ++i;
+          long_sig[i] = DBUS_TYPE_INT32;
+          ++i;
         }
-      n_begins = i / 2;
+      n_begins = i / 3;
 
       long_sig[i] = DBUS_TYPE_INT32;
       ++i;
-      long_sig[i] = DBUS_TYPE_INT32;
-      ++i;
       
       while (n_begins > 0)
         {

Index: dbus-test.c
===================================================================
RCS file: /cvs/dbus/dbus/dbus/dbus-test.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- dbus-test.c	28 Jan 2005 03:06:56 -0000	1.39
+++ dbus-test.c	11 Feb 2005 01:13:45 -0000	1.40
@@ -118,7 +118,7 @@
 
   check_memleaks ();
 
-#if 1
+#if 0
   printf ("%s: running recursive marshalling tests\n", "dbus-test");
   if (!_dbus_marshal_recursive_test ())
     die ("recursive marshal");



More information about the dbus-commit mailing list