summaryrefslogtreecommitdiffstats
path: root/hcid/dbus-manager.c
diff options
context:
space:
mode:
Diffstat (limited to 'hcid/dbus-manager.c')
-rw-r--r--hcid/dbus-manager.c4
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);