]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Make sta NULL-check easier for static analyzers
authorJouni Malinen <j@w1.fi>
Sat, 26 Apr 2014 08:51:19 +0000 (11:51 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 29 Apr 2014 09:52:10 +0000 (12:52 +0300)
sta == NULL check is already done above based on category !=
WLAN_ACTION_PUBLIC, but that seems to be too complex for some static
analyzers, so avoid invalid reports by explicitly checking for this
again in the WLAN_ACTION_FT case.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/ap/ieee802_11.c

index 62e2888bcc77c8af827e7a98ff869e52ae18bbc6..ca8db8fb00de22d76d109ff61cfec826225cf420 100644 (file)
@@ -1626,7 +1626,8 @@ static int handle_action(struct hostapd_data *hapd,
        switch (mgmt->u.action.category) {
 #ifdef CONFIG_IEEE80211R
        case WLAN_ACTION_FT:
-               if (wpa_ft_action_rx(sta->wpa_sm, (u8 *) &mgmt->u.action,
+               if (!sta ||
+                   wpa_ft_action_rx(sta->wpa_sm, (u8 *) &mgmt->u.action,
                                     len - IEEE80211_HDRLEN))
                        break;
                return 1;