From 7e20502f7adc5a067eb41b261348d39190de9e3c Mon Sep 17 00:00:00 2001 From: Karthikeyan Kathirvel Date: Mon, 20 Jul 2020 22:22:01 +0530 Subject: [PATCH] hostapd: Resolved compiler uninitialized warning 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 --- src/ap/ieee802_11.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c index e3a9cbee9..bff8bac25 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c @@ -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;