3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-19 10:02:33 +01:00

eapol: Fix bogus warning

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.
This commit is contained in:
Denis Kenzior 2024-08-19 11:39:42 -05:00
parent f81855349a
commit 7604762013

View File

@ -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;