From: Jouni Malinen Date: Sun, 8 Mar 2020 14:32:47 +0000 (+0200) Subject: SAE: Check sta pointer more consistently in testing code X-Git-Tag: hostap_2_10~1649 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7dcc5f7febfb3d96a1a543a539c6a8e892d5b5e6;p=thirdparty%2Fhostap.git SAE: Check sta pointer more consistently in testing code send_auth_reply() could be called with sta == NULL in certain error conditions. While that is not applicable for this special test functionality for SAE, the inconsistent checks for the sta pointer could result in warnings from static analyzers. Address this by explicitly checking the sta pointer here. Signed-off-by: Jouni Malinen --- diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c index 70de7d856..89c15b8e6 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c @@ -383,7 +383,7 @@ static int send_auth_reply(struct hostapd_data *hapd, struct sta_info *sta, #ifdef CONFIG_SAE if (hapd->conf->sae_confirm_immediate == 2 && auth_alg == WLAN_AUTH_SAE) { - if (auth_transaction == 1 && + if (auth_transaction == 1 && sta && (resp == WLAN_STATUS_SUCCESS || resp == WLAN_STATUS_SAE_HASH_TO_ELEMENT)) { wpa_printf(MSG_DEBUG,