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 <j@w1.fi>
This commit is contained in:
Jouni Malinen 2020-03-08 16:32:47 +02:00
parent 15d63c6043
commit 7dcc5f7feb

View File

@ -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,