]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
RSNO: Protect wpa_ie_buf3 from reuse explicitly
authorAdil Saeed Musthafa <quic_adilm@quicinc.com>
Thu, 25 Jul 2024 19:51:07 +0000 (12:51 -0700)
committerJouni Malinen <j@w1.fi>
Thu, 25 Jul 2024 21:03:51 +0000 (21:03 +0000)
Use else-if check for better clarity regarding usage of wpa_ie_buf3 to
make it explicit that memory is allocated for this pointer only once.

Signed-off-by: Adil Saeed Musthafa <quic_adilm@quicinc.com>
src/ap/wpa_auth.c

index 07844e43613bda26dc8a030a650c823ee781c405..68a868a0088db070426a895da4d2179bfe71dd69 100644 (file)
@@ -4713,9 +4713,9 @@ SM_STATE(WPA_PTK, PTKINITNEGOTIATING)
                wpa_ie_len = pos - wpa_ie_buf3;
                wpa_hexdump(MSG_DEBUG, "EAPOL-Key msg 3/4 IEs after edits",
                            wpa_ie, wpa_ie_len);
-       }
-       if ((conf->rsn_override_key_mgmt || conf->rsn_override_key_mgmt_2) &&
-           !sm->rsn_override && !sm->rsn_override_2) {
+       } else if ((conf->rsn_override_key_mgmt ||
+                   conf->rsn_override_key_mgmt_2) &&
+                  !sm->rsn_override && !sm->rsn_override_2) {
                u8 *ie;
                size_t ie_len;
                u32 ids[] = {