]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
FILS: Check kde more consistently to avoid static analyzer warnings
authorJeffin Mammen <jmammen@codeaurora.org>
Fri, 2 Mar 2018 19:10:38 +0000 (21:10 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 2 Mar 2018 19:27:30 +0000 (21:27 +0200)
For FILS, __wpa_send_eapol() is called only with the kde != NULL, but a
static analyzer might not understand that. Add an explicit check kde !=
NULL similarly to the other cases going through the kde parameter to
silence such bogus warnings.

Signed-off-by: Jeffin Mammen <jmammen@codeaurora.org>
src/ap/wpa_auth.c

index 9b287af9efd3fa9d6a3e90b5ea83905715c87e03..f3d1bbdc487bcc053766354cd5f2b51391c87575 100644 (file)
@@ -1492,7 +1492,7 @@ void __wpa_send_eapol(struct wpa_authenticator *wpa_auth,
                os_memcpy(key_data, kde, kde_len);
                WPA_PUT_BE16(key_mic + mic_len, kde_len);
 #ifdef CONFIG_FILS
-       } else if (!mic_len) {
+       } else if (!mic_len && kde) {
                const u8 *aad[1];
                size_t aad_len[1];