]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WNM: Fix Sleep Mode AP processing in open network
authorJouni Malinen <j@w1.fi>
Thu, 26 Dec 2013 19:08:50 +0000 (21:08 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 26 Dec 2013 20:26:05 +0000 (22:26 +0200)
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>

src/ap/wpa_auth.c

index 1f0b061855075c18f7e69c81f006e1a74cf064ff..ef33929e1533bf6fca5fb55ac265a69d980eaa40 100644 (file)
@@ -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,7 +2466,8 @@ void wpa_wnmsleep_rekey_gtk(struct wpa_state_machine *sm)
 
 void wpa_set_wnmsleep(struct wpa_state_machine *sm, int flag)
 {
-       sm->is_wnmsleep = !!flag;
+       if (sm)
+               sm->is_wnmsleep = !!flag;
 }