From f5e6af18d2b3f8900887a939af1cd34dc1728573 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Thu, 10 Oct 2013 15:51:18 +0200 Subject: [PATCH] monitor: Fix integer overruns with EIR parsing For tracking how much has been parsed of the EIR we must use a greater than uint8 integer to avoid having a large (e.g. 255) field length cause our counter to wrap around and start from zero. --- monitor/packet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monitor/packet.c b/monitor/packet.c index 9badfcdc0..590f9e3fc 100644 --- a/monitor/packet.c +++ b/monitor/packet.c @@ -2231,7 +2231,7 @@ static const struct { static void print_eir(const uint8_t *eir, uint8_t eir_len, bool le) { - uint8_t len = 0; + uint16_t len = 0; if (eir_len == 0) return; -- 2.11.0