diff options
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | bus/signals.c | 9 | ||||
-rw-r--r-- | configure.in | 9 | ||||
-rw-r--r-- | dbus/dbus-protocol.h | 3 | ||||
-rw-r--r-- | test/decode-gcov.c | 4 |
5 files changed, 35 insertions, 0 deletions
@@ -1,5 +1,15 @@ 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). * bus/bus.c (bus_context_check_security_policy): fix up to handle diff --git a/bus/signals.c b/bus/signals.c index 960d846c..0fd4b514 100644 --- a/bus/signals.c +++ b/bus/signals.c @@ -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)); diff --git a/configure.in b/configure.in index 8a2c7aad..e128fddf 100644 --- a/configure.in +++ b/configure.in @@ -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) diff --git a/dbus/dbus-protocol.h b/dbus/dbus-protocol.h index a0cf54ef..549ef0e5 100644 --- a/dbus/dbus-protocol.h +++ b/dbus/dbus-protocol.h @@ -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 diff --git a/test/decode-gcov.c b/test/decode-gcov.c index a7a4478b..29f061f7 100644 --- a/test/decode-gcov.c +++ b/test/decode-gcov.c @@ -38,6 +38,10 @@ #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 |