D-Bus: Fix operations when P2P management interface is used
authorJouni Malinen <jouni@qca.qualcomm.com>
Wed, 29 Apr 2015 10:13:34 +0000 (13:13 +0300)
committerJouni Malinen <j@w1.fi>
Wed, 29 Apr 2015 17:42:25 +0000 (20:42 +0300)
commit8a78e227df1ead19be8e12a4108e448887e64d6f
tree323221db427eb0bb3f5fd9c64284f59425fbb15d
parentdea0d8ee295983358e300c84af006bfbd79c5500
D-Bus: Fix operations when P2P management interface is used

Commit 21efc940f6e7f07b84b7e5c5867f3d81594c4fb0 ('wpa_supplicant: Do not
register a P2P management interface on DBus') hides the special P2P
management interface from D-Bus. However, it did not take into account
the possibility of wpa_s->dbus_path and wpa_s->dbus_new_path being NULL
in such cases on number of code paths within the D-Bus handlers. This
could result in invalid arguments (NULL path) being provided to D-Bus
functions (mainly, dbus_message_iter_append_basic) and NULL pointer
dereference when iterating over all interfaces. Either of these could
make wpa_supplicant process terminate.

Fix this by explicitly checking that the interface-specific D-Bus path
has been registered before using it anywhere with D-Bus handlers. In
addition, find the correct wpa_s instance to fix P2P operations through
D-Bus when the P2P Device interface is used.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
wpa_supplicant/dbus/dbus_new.c
wpa_supplicant/dbus/dbus_new_handlers.c
wpa_supplicant/dbus/dbus_new_handlers_p2p.c
wpa_supplicant/dbus/dbus_new_handlers_wps.c
wpa_supplicant/dbus/dbus_old.c
wpa_supplicant/dbus/dbus_old_handlers.c