From da179bd0e12d6a7b1e5f85a3bec5d1b6ec3c8e1f Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Fri, 21 Feb 2014 13:05:37 +0200 Subject: [PATCH] WPS: Fix parsing of 0-length WFA vendor extension subelement The previous parser would have skipped a WFA vendor extension attribute that includes only a single zero-length subelement. No such subelement has been defined so far, so this does not really affect any functionality, but better make the parser address this correctly should such an element ever be added. Signed-off-by: Jouni Malinen --- src/wps/wps_attr_parse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wps/wps_attr_parse.c b/src/wps/wps_attr_parse.c index b04c22219..1ebcfe9d2 100644 --- a/src/wps/wps_attr_parse.c +++ b/src/wps/wps_attr_parse.c @@ -75,7 +75,7 @@ static int wps_parse_vendor_ext_wfa(struct wps_parse_attr *attr, const u8 *pos, const u8 *end = pos + len; u8 id, elen; - while (pos + 2 < end) { + while (pos + 2 <= end) { id = *pos++; elen = *pos++; if (pos + elen > end)