diff options
author | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2006-11-08 18:52:20 +0000 |
---|---|---|
committer | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2006-11-08 18:52:20 +0000 |
commit | 34a3fbf5f13e556e2a6e0c91a28b4a857ec67b62 (patch) | |
tree | 09dfea4396141a11202b93d78f8c93777cb91a40 /hcid/dbus-manager.c | |
parent | 6bf68118fef86f78d7e8450ea43de45a73a33921 (diff) |
Prevent segmentation fault if the D-Bus path data is NULL
Diffstat (limited to 'hcid/dbus-manager.c')
-rw-r--r-- | hcid/dbus-manager.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/hcid/dbus-manager.c b/hcid/dbus-manager.c index 53095769..6022f97c 100644 --- a/hcid/dbus-manager.c +++ b/hcid/dbus-manager.c @@ -418,7 +418,7 @@ static DBusHandlerResult add_service_record(DBusConnection *conn, return error_invalid_arguments(conn, msg); } - if (strcmp(dbus_message_get_sender(msg), agent->id)) + if (!agent || strcmp(dbus_message_get_sender(msg), agent->id)) return error_not_authorized(conn, msg); dbus_message_iter_next(&iter); @@ -501,7 +501,7 @@ static DBusHandlerResult remove_service_record(DBusConnection *conn, return error_invalid_arguments(conn, msg); } - if (strcmp(dbus_message_get_sender(msg), agent->id)) + if (!agent || strcmp(dbus_message_get_sender(msg), agent->id)) return error_not_authorized(conn, msg); |