From cd32365b7df292e229139788aba843183c8598d7 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 3 Sep 2006 00:41:45 +0000 Subject: Check discovery_requestor before using it --- hcid/dbus-adapter.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); -- cgit