From: Jouni Malinen Date: Sat, 26 Apr 2014 08:51:19 +0000 (+0300) Subject: Make sta NULL-check easier for static analyzers X-Git-Tag: hostap_2_2~215 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d6c6b1fb9d0408d1c196c638a11245db9ab5f4eb;p=thirdparty%2Fhostap.git Make sta NULL-check easier for static analyzers 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 --- diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c index 62e2888bc..ca8db8fb0 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c @@ -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;