diff --git a/core/rtw_ieee80211.c b/core/rtw_ieee80211.c index 808d940..efc84d7 100644 --- a/core/rtw_ieee80211.c +++ b/core/rtw_ieee80211.c @@ -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; }