Do not proceed with association if get_bssid() returns failure
authorMasashi Honma <masashi.honma@gmail.com>
Sat, 11 Aug 2012 14:46:58 +0000 (17:46 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 11 Aug 2012 14:46:58 +0000 (17:46 +0300)
commit0a0c38f63d825b352deb819b32a0fb1203eb936c
tree899e3dce53b38b0d1a62abf7404e5b56ef3f0b53
parentb6871ebb1735e86ef02d59318d790f336844e822
Do not proceed with association if get_bssid() returns failure

This is the normal flow for association:

wpa_supplicant <--(EVENT_ASSOC event )--  device driver
wpa_supplicant  --( get_bssid()      )--> device driver
wpa_supplicant <--( return BSSID     )--  device driver

However, a device driver could return EINVAL for get_bssid() because it
recognizes it has already been disconnected. When the wpa_supplicant
received EINVAL, the bssid field could be used uninitialized in the
following flow:

wpa_supplicant <--(EVENT_ASSOC event )--  device driver
                                          device driver (receive deauth)
wpa_supplicant  --( get_bssid()      )--> device driver
wpa_supplicant <--( return EINVAL    )--  device driver

Prevent this by requiring the get_bssid() call to succeed when
processing association events.
wpa_supplicant/events.c