From: Jouni Malinen Date: Thu, 12 Jun 2014 20:33:33 +0000 (+0300) Subject: WNM: Use cleaner way of generating pointer to a field (CID 68100) X-Git-Tag: hostap_2_3~314 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2703fb4ad92f9114e76ffc5d3015ec30cc5e1448;p=thirdparty%2Fhostap.git WNM: Use cleaner way of generating pointer to a field (CID 68100) The Action code field is in a fixed location, so the IEEE80211_HDRLEN can be used here to clean up bounds checking to avoid false reports from static analyzer. Signed-off-by: Jouni Malinen --- diff --git a/wpa_supplicant/wnm_sta.c b/wpa_supplicant/wnm_sta.c index e395ef1d7..4a792c4b1 100644 --- a/wpa_supplicant/wnm_sta.c +++ b/wpa_supplicant/wnm_sta.c @@ -921,8 +921,7 @@ void ieee802_11_rx_wnm_action(struct wpa_supplicant *wpa_s, if (len < IEEE80211_HDRLEN + 2) return; - pos = &mgmt->u.action.category; - pos++; + pos = ((const u8 *) mgmt) + IEEE80211_HDRLEN + 1; act = *pos++; end = ((const u8 *) mgmt) + len;