From 7604762013b6859c42bc92374559d309bd0aadb6 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Mon, 19 Aug 2024 11:39:42 -0500 Subject: [PATCH] eapol: Fix bogus warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit src/eapol.c:1041:9: error: ‘buf’ may be used uninitialized [-Werror=maybe-uninitialized] 1041 | l_put_be16(0, &frame->header.packet_len); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This warning is bogus since the buffer is initialized through use of eapol_frame members. EAPoL-Start is a very simple frame. --- src/eapol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/eapol.c b/src/eapol.c index 6d176304..6e37a54a 100644 --- a/src/eapol.c +++ b/src/eapol.c @@ -1033,7 +1033,7 @@ static void eapol_install_igtk(struct eapol_sm *sm, uint16_t igtk_key_index, static void __send_eapol_start(struct eapol_sm *sm, bool noencrypt) { - uint8_t buf[sizeof(struct eapol_frame)]; + uint8_t buf[sizeof(struct eapol_frame)] = {}; struct eapol_frame *frame = (struct eapol_frame *) buf; frame->header.protocol_version = EAPOL_PROTOCOL_VERSION_2001;