]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
hostapd: Resolved compiler uninitialized warning
authorKarthikeyan Kathirvel <kathirve@codeaurora.org>
Mon, 20 Jul 2020 16:52:01 +0000 (22:22 +0530)
committerJouni Malinen <j@w1.fi>
Tue, 22 Sep 2020 20:29:18 +0000 (23:29 +0300)
Resolved the below warning
../src/ap/ieee802_11.c:4535:25: warning: 'reply_res' may be used
uninitialized in this function [-Wmaybe-uninitialized]
  if (sta && ((reply_res != WLAN_STATUS_SUCCESS &&
                           ^
Since reply_res is been assigned inside an if condition and so
compiler treats reply_res as uninitalized variable

Initialize reply_res with WLAN_STATUS_UNSPECIFIED_FAILURE.

Fixes: 5344af7d22ac ("FT: Discard ReassocReq with mismatching RSNXE Used value")
Signed-off-by: Karthikeyan Kathirvel <kathirve@codeaurora.org>
src/ap/ieee802_11.c

index e3a9cbee90040b5cef1bcb40ff3cb230a4463234..bff8bac25e3afd7091d01e2fcb158e9ecc77a650 100644 (file)
@@ -4148,7 +4148,7 @@ static void handle_assoc(struct hostapd_data *hapd,
 {
        u16 capab_info, listen_interval, seq_ctrl, fc;
        int resp = WLAN_STATUS_SUCCESS;
-       u16 reply_res;
+       u16 reply_res = WLAN_STATUS_UNSPECIFIED_FAILURE;
        const u8 *pos;
        int left, i;
        struct sta_info *sta;