mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-25 08:48:31 -05:00
WPS: Fix num_probereq_cb clearing on DISABLE to avoid segfault
Reset hapd->num_probereq_cb to 0 on an interface deinit to avoid unexpected behavior if the same interface is enabled again without fully freeing the data structures. hostapd_register_probereq_cb() increments hapd->num_probereq_cb by one and leaves all old values unchanged. In this deinit+init case, that would result in the first entry in the list having an uninitialized pointer and the next Probe Request frame processing would likely cause the process to terminate on segmentation fault. This issue could be hit when hostapd was used with WPS enabled (non-zero wps_state configuration parameter) and control interface command DISABLE and ENABLE were used. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
parent
ae3eacf771
commit
24fd20438f
@ -261,6 +261,7 @@ static void hostapd_free_hapd_data(struct hostapd_data *hapd)
|
||||
{
|
||||
os_free(hapd->probereq_cb);
|
||||
hapd->probereq_cb = NULL;
|
||||
hapd->num_probereq_cb = 0;
|
||||
|
||||
#ifdef CONFIG_P2P
|
||||
wpabuf_free(hapd->p2p_beacon_ie);
|
||||
|
Loading…
Reference in New Issue
Block a user