WNM: Use cleaner way of generating pointer to a field (CID 68099)

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 <j@w1.fi>
This commit is contained in:
Jouni Malinen 2014-06-12 22:36:02 +03:00
parent 062833c67c
commit da995b2e11
1 changed files with 2 additions and 3 deletions

View File

@ -376,10 +376,9 @@ int ieee802_11_rx_wnm_action_ap(struct hostapd_data *hapd,
if (len < IEEE80211_HDRLEN + 2)
return -1;
payload = &mgmt->u.action.category;
payload++;
payload = ((const u8 *) mgmt) + IEEE80211_HDRLEN + 1;
action = *payload++;
plen = (((const u8 *) mgmt) + len) - payload;
plen = len - IEEE80211_HDRLEN - 2;
switch (action) {
case WNM_BSS_TRANS_MGMT_QUERY: