Skip to contentSkip to conversation

eap: fix uninitialized variable error

PATCH Superseded James Prestwood 1 participant 1 message Nov 8, 2021

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

James Prestwood

author
#0 lore raw

PATCH 1/1 eap: fix uninitialized variable error

src/eap.c: In function ‘eap_rx_packet’:
src/eap.c:417:57: error: ‘vendor_type’ may be used uninitialized in this
function [-Werror=maybe-uninitialized]
417 | (type == EAP_TYPE_EXPANDED && vendor_id == (id) && vendor_type == (t))

---
 src/eap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/eap.c +1 -1
index 10381af7..b67049fd 100644
@@ -424,7 +424,7 @@ static void eap_handle_response(struct eap_state *eap, const uint8_t *pkt,
 {
 	enum eap_type type;
 	uint32_t vendor_id;
-	uint32_t vendor_type;
+	uint32_t vendor_type = 0;
 	enum eap_type our_type = eap->method->request_type;
 	uint32_t our_vendor_id = (eap->method->vendor_id[0] << 16) |
 				(eap->method->vendor_id[1] << 8) |
Signature · 1 line
2.31.1