path: root/wpa_supplicant/notify.c
diff options
authorJouni Malinen <j@w1.fi>2014-12-26 16:19:36 (GMT)
committerJouni Malinen <j@w1.fi>2014-12-29 13:49:05 (GMT)
commit11973b268229a754cd930b0a3a7cf5e89202c2aa (patch)
treeeed0a1a93301bf71f76a67d10cf298ac13e9c760 /wpa_supplicant/notify.c
parentb8db1dfc5ca85b3443dab7757853b68687921d8e (diff)
D-Bus: Fix P2P peer joined/disconnected handlers
It is possible for the peer to be a non-P2P device and as such, for p2p_dev_addr to be NULL. This resulted in NULL pointer dereference if D-Bus interface was enabled for the interface when a legacy STA joined a group. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant/notify.c')
1 files changed, 4 insertions, 2 deletions
diff --git a/wpa_supplicant/notify.c b/wpa_supplicant/notify.c
index c8cfa47..de33019 100644
--- a/wpa_supplicant/notify.c
+++ b/wpa_supplicant/notify.c
@@ -648,7 +648,8 @@ static void wpas_notify_ap_sta_authorized(struct wpa_supplicant *wpa_s,
* Create 'peer-joined' signal on group object -- will also
* check P2P itself.
- wpas_dbus_signal_p2p_peer_joined(wpa_s, p2p_dev_addr);
+ if (p2p_dev_addr)
+ wpas_dbus_signal_p2p_peer_joined(wpa_s, p2p_dev_addr);
#endif /* CONFIG_P2P */
/* Notify listeners a new station has been authorized */
@@ -665,7 +666,8 @@ static void wpas_notify_ap_sta_deauthorized(struct wpa_supplicant *wpa_s,
* Create 'peer-disconnected' signal on group object if this
* is a P2P group.
- wpas_dbus_signal_p2p_peer_disconnected(wpa_s, p2p_dev_addr);
+ if (p2p_dev_addr)
+ wpas_dbus_signal_p2p_peer_disconnected(wpa_s, p2p_dev_addr);
#endif /* CONFIG_P2P */
/* Notify listeners a station has been deauthorized */