From 659ac96d7f4e52b2e14fc2d4a63c5a65833a84c1 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Wed, 7 Feb 2018 12:34:41 +0200 Subject: [PATCH] ieee802_11_mgmt: Handle frame info more consistently Check for the fi parameter to be non-NULL before trying to fetch the ssi_signal information similarly to how the fi->freq was already handled. While the meta information is supposed to be available, it looks like there is at least one corner case where fi == NULL could be used (Authentication frame reprocessing after RADIUS-based ACL). Signed-off-by: Jouni Malinen --- src/ap/ieee802_11.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c index 38487a883..8269b72b1 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c @@ -3829,6 +3829,7 @@ int ieee802_11_mgmt(struct hostapd_data *hapd, const u8 *buf, size_t len, u16 fc, stype; int ret = 0; unsigned int freq; + int ssi_signal = fi ? fi->ssi_signal : 0; if (len < 24) return 0; @@ -3864,7 +3865,7 @@ int ieee802_11_mgmt(struct hostapd_data *hapd, const u8 *buf, size_t len, if (stype == WLAN_FC_STYPE_PROBE_REQ) { - handle_probe_req(hapd, mgmt, len, fi->ssi_signal); + handle_probe_req(hapd, mgmt, len, ssi_signal); return 1; } @@ -3879,7 +3880,7 @@ int ieee802_11_mgmt(struct hostapd_data *hapd, const u8 *buf, size_t len, } if (hapd->iconf->track_sta_max_num) - sta_track_add(hapd->iface, mgmt->sa, fi->ssi_signal); + sta_track_add(hapd->iface, mgmt->sa, ssi_signal); switch (stype) { case WLAN_FC_STYPE_AUTH: