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
This commit is contained in:
Havoc Pennington 2003-10-10 03:56:30 +00:00
parent 6a65f4802e
commit c1f0e18903
5 changed files with 35 additions and 0 deletions

View file

@ -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).

View 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));

View 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)

View 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

View file

@ -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