summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuel VAUTRIN <Emmanuel.VAUTRIN@cpexterne.org>2022-01-06 15:11:34 +0100
committerDaniel Wagner <wagi@monom.org>2022-01-21 08:51:51 +0100
commitcf29dde8d2ff2f7afe1c83ab811d118265e832da (patch)
tree8fe92dde5190993131ca5db1bd4ff022261b09e5
parente16b4105baaabf5403ebd506f5fa90b2eccbed4b (diff)
downloadconnman-cf29dde8d2ff2f7afe1c83ab811d118265e832da.tar.gz
iwd: Fix connection with no passphrase
During a failing connection on a secure network with no passphrase, agent_request_passphrase() crashes, trying to manipulate the value of the "WiFi.Passphrase" key, which is null. Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
-rw-r--r--plugins/iwd.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/plugins/iwd.c b/plugins/iwd.c
index bb97262e..0569f302 100644
--- a/plugins/iwd.c
+++ b/plugins/iwd.c
@@ -1489,6 +1489,8 @@ static DBusMessage *agent_request_passphrase(DBusConnection *dbus_conn,
return get_reply_on_error(message, EINVAL);
passwd = connman_network_get_string(iwdn->network, "WiFi.Passphrase");
+ if (!passwd)
+ return get_reply_on_error(message, ENOKEY);
return g_dbus_create_reply(message, DBUS_TYPE_STRING, &passwd,
DBUS_TYPE_INVALID);