diff options
author | Olivier Andrieu <oliv__a@users.sourceforge.net> | 2004-09-27 10:01:18 +0000 |
---|---|---|
committer | Olivier Andrieu <oliv__a@users.sourceforge.net> | 2004-09-27 10:01:18 +0000 |
commit | 73a69d496bb26356d684774cd1e98646a443c723 (patch) | |
tree | 3398ffd1156c558d8dc94d060bd608016a171e3e /dbus/dbus-bus.c | |
parent | 85f8f62da6bb26d7033310af9d3260b073efe4bf (diff) |
* bus/signals.c (bus_match_rule_parse): validate the components of
match rules (bug #1439).
* dbus/dbus-bus.c (dbus_bus_add_match): add a missing OOM test.
Diffstat (limited to 'dbus/dbus-bus.c')
-rw-r--r-- | dbus/dbus-bus.c | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/dbus/dbus-bus.c b/dbus/dbus-bus.c index ec8d7b6a..a310a6cd 100644 --- a/dbus/dbus-bus.c +++ b/dbus/dbus-bus.c @@ -338,7 +338,7 @@ dbus_bus_get (DBusBusType type, if (!init_connections_unlocked ()) { _DBUS_UNLOCK (bus); - dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL); + _DBUS_SET_OOM (error); return NULL; } @@ -842,25 +842,15 @@ send_no_return_values (DBusConnection *connection, -1, error); if (reply == NULL) - { - _DBUS_ASSERT_ERROR_IS_SET (error); - return; - } - - if (dbus_set_error_from_message (error, reply)) - { - _DBUS_ASSERT_ERROR_IS_SET (error); - dbus_message_unref (reply); - return; - } - - dbus_message_unref (reply); + _DBUS_ASSERT_ERROR_IS_SET (error); + else + dbus_message_unref (reply); } else { /* Silently-fail nonblocking codepath */ - if (!dbus_connection_send (connection, msg, NULL)) - return; + dbus_message_set_no_reply (msg, TRUE); + dbus_connection_send (connection, msg, NULL); } } @@ -898,6 +888,12 @@ dbus_bus_add_match (DBusConnection *connection, DBUS_INTERFACE_ORG_FREEDESKTOP_DBUS, "AddMatch"); + if (msg == NULL) + { + _DBUS_SET_OOM (error); + return; + } + if (!dbus_message_append_args (msg, DBUS_TYPE_STRING, rule, DBUS_TYPE_INVALID)) { |