rtl8188eu: Fix infinite loop in rtw_get_wps_ie()

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2022-07-16 13:48:04 -05:00
parent 30901e601a
commit e43ffc5f23

View file

@ -747,6 +747,7 @@ u8 *rtw_get_wps_ie(u8 *in_ie, uint in_len, u8 *wps_ie, uint *wps_ielen)
uint cnt;
u8 *wpsie_ptr = NULL;
u8 eid, wps_oui[4] = {0x0, 0x50, 0xf2, 0x04};
int loop = 0;
if (wps_ielen)
*wps_ielen = 0;
@ -774,6 +775,8 @@ u8 *rtw_get_wps_ie(u8 *in_ie, uint in_len, u8 *wps_ie, uint *wps_ielen)
} else {
cnt += in_ie[cnt+1]+2; /* goto next */
}
if (++loop > 1000)
return NULL;
}
return wpsie_ptr;
}