aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/dbus/dbus_new_handlers.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2016-06-24 20:49:08 (GMT)
committerJouni Malinen <j@w1.fi>2016-06-24 20:49:08 (GMT)
commitfc1e2c0d91a15a13d30219a5f5d2878197368902 (patch)
tree72483186403ede0582664d69ec2455cb27d0b1ea /wpa_supplicant/dbus/dbus_new_handlers.c
parente7d454bb76d1fd88f976f561f0e7fe9df5453ed0 (diff)
downloadhostap-fc1e2c0d91a15a13d30219a5f5d2878197368902.zip
hostap-fc1e2c0d91a15a13d30219a5f5d2878197368902.tar.gz
hostap-fc1e2c0d91a15a13d30219a5f5d2878197368902.tar.bz2
D-Bus: Make the CurrentAuthMode property getter more robust
Now that mesh sets wpa_s->wpa_state = WPA_COMPLETED, it looks like this getter can get called with wpa_s->current_ssid = NULL. That could result in NULL pointer dereference, so need to protect that specific case. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant/dbus/dbus_new_handlers.c')
-rw-r--r--wpa_supplicant/dbus/dbus_new_handlers.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/wpa_supplicant/dbus/dbus_new_handlers.c b/wpa_supplicant/dbus/dbus_new_handlers.c
index 27029c5..de6d216 100644
--- a/wpa_supplicant/dbus/dbus_new_handlers.c
+++ b/wpa_supplicant/dbus/dbus_new_handlers.c
@@ -3228,9 +3228,11 @@ dbus_bool_t wpas_dbus_getter_current_auth_mode(
"EAP-%s", eap_mode);
auth_mode = eap_mode_buf;
- } else {
+ } else if (wpa_s->current_ssid) {
auth_mode = wpa_key_mgmt_txt(wpa_s->key_mgmt,
wpa_s->current_ssid->proto);
+ } else {
+ auth_mode = "UNKNOWN";
}
return wpas_dbus_simple_property_getter(iter, DBUS_TYPE_STRING,