From: Karthikeyan Kathirvel Date: Mon, 20 Jul 2020 16:52:01 +0000 (+0530) Subject: hostapd: Resolved compiler uninitialized warning X-Git-Tag: hostap_2_10~957 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e20502f7adc5a067eb41b261348d39190de9e3c;p=thirdparty%2Fhostap.git 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 --- 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;