From 8bcb8e870e3c0824ae8cab8824d0bdf3bb8cb105 Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Fri, 12 Jul 2019 15:30:50 -0700 Subject: [PATCH] ie: fix incorrect length check for hotspot indication The length check was incorrectly assuming that PPS MO ID or ANQP Domain ID would be present in the IE. Both these are optional and without then the minimum length is 5 bytes, not 7. --- src/ie.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ie.c b/src/ie.c index cd31797c..69b31a84 100644 --- a/src/ie.c +++ b/src/ie.c @@ -1287,7 +1287,7 @@ bool is_ie_wfa_ie(const uint8_t *data, uint8_t len, uint8_t oi_type) if (oi_type == IE_WFA_OI_OSEN && len < 22) return false; - else if (oi_type == IE_WFA_OI_HS20_INDICATION && len < 7) + else if (oi_type == IE_WFA_OI_HS20_INDICATION && len < 5) return false; else if (len < 4) /* OI not handled, but at least check length */ return false;