summaryrefslogtreecommitdiffstats
path: root/hcid
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2006-09-03 00:41:45 +0000
committerMarcel Holtmann <marcel@holtmann.org>2006-09-03 00:41:45 +0000
commitcd32365b7df292e229139788aba843183c8598d7 (patch)
treec9fe3a8672bffec11c5b36717a21f94e1bb6413f /hcid
parent3d6f08cb24a31bf76cb3e934dddbc1f8d52d4c94 (diff)
Check discovery_requestor before using it
Diffstat (limited to 'hcid')
-rw-r--r--hcid/dbus-adapter.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hcid/dbus-adapter.c b/hcid/dbus-adapter.c
index 4dcd629f..d52a8f6a 100644
--- a/hcid/dbus-adapter.c
+++ b/hcid/dbus-adapter.c
@@ -2265,7 +2265,8 @@ static DBusHandlerResult handle_dev_cancel_discovery_req(DBusConnection *conn, D
return error_not_authorized(conn, msg); /* FIXME: find a better error name */
/* only the discover requestor can cancel the inquiry process */
- if (strcmp(dbus_data->discovery_requestor, requestor_name))
+ if (!dbus_data->discovery_requestor ||
+ strcmp(dbus_data->discovery_requestor, requestor_name))
return error_not_authorized(conn, msg);
dd = hci_open_dev(dbus_data->dev_id);