dbus/bus signals.c,1.3,1.4

Havoc Pennington hp@pdx.freedesktop.org
Thu, 09 Oct 2003 20:56:32 -0700


Update of /cvs/dbus/dbus/bus
In directory pdx:/tmp/cvs-serv17200/bus

Modified Files:
	signals.c 
Log Message:
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



Index: signals.c
===================================================================
RCS file: /cvs/dbus/dbus/bus/signals.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- signals.c	10 Oct 2003 02:42:20 -0000	1.3
+++ signals.c	10 Oct 2003 03:56:30 -0000	1.4
@@ -586,6 +586,15 @@
   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));