]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
SAE: Check sta pointer more consistently in testing code
authorJouni Malinen <j@w1.fi>
Sun, 8 Mar 2020 14:32:47 +0000 (16:32 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 8 Mar 2020 14:32:47 +0000 (16:32 +0200)
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>
src/ap/ieee802_11.c

index 70de7d85664d6b8e1131b74d5432ce79a76d584a..89c15b8e62763723da8fdef1ab6a1fb9e6dc81d6 100644 (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,