]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
2003-10-09 Havoc Pennington <hp@redhat.com>
authorHavoc Pennington <hp@redhat.com>
Fri, 10 Oct 2003 03:56:30 +0000 (03:56 +0000)
committerHavoc Pennington <hp@redhat.com>
Fri, 10 Oct 2003 03:56:30 +0000 (03:56 +0000)
* configure.in: define DBUS_HAVE_GCC33_GCOV if we have
gcc 3.3. Not that we do anything about it yet.

* bus/signals.c (bus_match_rule_parse): impose max length on the
match rule text

* dbus/dbus-protocol.h: add DBUS_MAXIMUM_MATCH_RULE_LENGTH

ChangeLog
bus/signals.c
configure.in
dbus/dbus-protocol.h
test/decode-gcov.c

index 920c23f46141efad0b2795e971f0419c5299ea86..a64b55ac0a0f487bb3a6523e925873178fa7661a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2003-10-09  Havoc Pennington  <hp@redhat.com>
+
+       * configure.in: define DBUS_HAVE_GCC33_GCOV if we have
+       gcc 3.3. Not that we do anything about it yet.
+
+       * bus/signals.c (bus_match_rule_parse): impose max length on the
+       match rule text
+
+       * dbus/dbus-protocol.h: add DBUS_MAXIMUM_MATCH_RULE_LENGTH
+
 2003-10-09  Havoc Pennington  <hp@redhat.com>
 
         Make matching rules theoretically work (add parser).
index 960d846cb8615e9fdf3535e827f9a309b5f39824..0fd4b5143c29846ab65ba0ba05aaf5d850333fd0 100644 (file)
@@ -586,6 +586,15 @@ bus_match_rule_parse (DBusConnection   *matches_go_to,
   int i;
   
   _DBUS_ASSERT_ERROR_IS_CLEAR (error);
+
+  if (_dbus_string_get_length (rule_text) > DBUS_MAXIMUM_MATCH_RULE_LENGTH)
+    {
+      dbus_set_error (error, DBUS_ERROR_LIMITS_EXCEEDED,
+                      "Match rule text is %d bytes, maximum is %d",
+                      _dbus_string_get_length (rule_text),
+                      DBUS_MAXIMUM_MATCH_RULE_LENGTH);
+      return NULL;
+    }
   
   memset (tokens, '\0', sizeof (tokens));
   
index 8a2c7aadb8503da70c1192546ac4c35775e7c947..e128fddf78c7ad2a94c9e76d0ae433e56e66ea1e 100644 (file)
@@ -223,6 +223,15 @@ changequote([,])dnl
 if test x$enable_gcov = xyes; then
      ## so that config.h changes when you toggle gcov support
      AC_DEFINE_UNQUOTED(DBUS_GCOV_ENABLED, 1, [Defined if gcov is enabled to force a rebuild due to config.h changing])
+
+     AC_MSG_CHECKING([for gcc 3.3 version of gcov file format])
+     have_gcc33_gcov=no
+     AC_RUN_IFELSE( [AC_LANG_PROGRAM( , [[ if (__GNUC__ >=3 && __GNUC_MINOR__ >= 3) exit (0); else exit (1); ]])],  
+                   have_gcc33_gcov=yes)
+     if test x$have_gcc33_gcov = xyes ; then
+         AC_DEFINE_UNQUOTED(DBUS_HAVE_GCC33_GCOV, 1, [Defined if we have gcc 3.3 and thus the new gcov format])
+     fi
+     AC_MSG_RESULT($have_gcc33_gcov)
 fi
 AM_CONDITIONAL(DBUS_GCOV_ENABLED, test x$enable_gcov = xyes)
 
index a0cf54ef86e91a975c9ef3c2912de7c0e42fb20f..549ef0e57e4cd6c1e8e6d2f425c4ee7756cee148 100644 (file)
@@ -60,6 +60,9 @@ extern "C" {
 /* Max length in bytes of a service or interface or member name */
 #define DBUS_MAXIMUM_NAME_LENGTH 256
 
+/* Max length of a match rule string */
+#define DBUS_MAXIMUM_MATCH_RULE_LENGTH 1024
+
 /* Types of message */
 #define DBUS_MESSAGE_TYPE_INVALID       0
 #define DBUS_MESSAGE_TYPE_METHOD_CALL   1
index a7a4478be29254b7c3b95de1acfb80a02895bfc8..29f061f727380a49570af88cd35d6d378403c17e 100644 (file)
 #include <stdlib.h>
 #include <string.h>
 
+#ifdef DBUS_HAVE_GCC33_GCOV
+#error "gcov support not yet implemented for gcc 3.3 and greater; the file format changed"
+#endif
+
 #ifndef DBUS_HAVE_INT64
 #error "gcov support can't be built without 64-bit integer support"
 #endif