WNM: Fix Sleep Mode AP processing in open network
The previous version could end up calling WPA authenticator routines even though the authenticator had not been initialized and this could result in NULL pointer dereference. Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
3c1060ff8f
commit
629edfef81
1 changed files with 3 additions and 2 deletions
|
@ -2457,7 +2457,7 @@ static int wpa_group_update_sta(struct wpa_state_machine *sm, void *ctx)
|
|||
/* update GTK when exiting WNM-Sleep Mode */
|
||||
void wpa_wnmsleep_rekey_gtk(struct wpa_state_machine *sm)
|
||||
{
|
||||
if (sm->is_wnmsleep)
|
||||
if (sm == NULL || sm->is_wnmsleep)
|
||||
return;
|
||||
|
||||
wpa_group_update_sta(sm, NULL);
|
||||
|
@ -2466,6 +2466,7 @@ void wpa_wnmsleep_rekey_gtk(struct wpa_state_machine *sm)
|
|||
|
||||
void wpa_set_wnmsleep(struct wpa_state_machine *sm, int flag)
|
||||
{
|
||||
if (sm)
|
||||
sm->is_wnmsleep = !!flag;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue