Mark the variable as unsigned and make the length check use "len > end -
pos" version to makes this easier to understand for static analyzers
(CID 74155).
Signed-off-by: Jouni Malinen <j@w1.fi>
{
int subelements[MAX_WFD_SUBELEMS] = {};
const u8 *pos, *end;
- int len, subelem;
+ unsigned int len, subelem;
struct wpabuf *e;
wpa_printf(MSG_DEBUG, "WFD IEs set: %p - %lu",
wpa_printf(MSG_DEBUG, "WFD Sub-Element ID %d - len %d",
*pos, len - 3);
- if (pos + len > end)
+ if (len > end - pos)
break;
subelem = *pos;