]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Avoid uninitialized seq number in debug print for testing functionality
authorJouni Malinen <quic_jouni@quicinc.com>
Mon, 22 Jan 2024 16:26:19 +0000 (18:26 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 22 Jan 2024 19:16:47 +0000 (21:16 +0200)
If the driver fetch for the current sequency number fails, do not try to
print the value in a debug print without having cleared it.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
src/ap/wpa_auth.c

index b14920486d48bc39b6afcaa0714a5bd65dea413f..f3fc85af15b6ece24a84fac22f299c6bdce9fdd6 100644 (file)
@@ -194,6 +194,9 @@ static inline int wpa_auth_get_seqnum(struct wpa_authenticator *wpa_auth,
 
        if (!wpa_auth->cb->get_seqnum)
                return -1;
+#ifdef CONFIG_TESTING_OPTIONS
+       os_memset(seq, 0, WPA_KEY_RSC_LEN);
+#endif /* CONFIG_TESTING_OPTIONS */
        res = wpa_auth->cb->get_seqnum(wpa_auth->cb_ctx, addr, idx, seq);
 #ifdef CONFIG_TESTING_OPTIONS
        if (!addr && idx < 4 && wpa_auth->conf.gtk_rsc_override_set) {