From e43ffc5f232fb8dc995fd90662828bfa48c36127 Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Sat, 16 Jul 2022 13:48:04 -0500 Subject: [PATCH] rtl8188eu: Fix infinite loop in rtw_get_wps_ie() Signed-off-by: Larry Finger --- core/rtw_ieee80211.c | 3 +++ 1 file changed, 3 insertions(+) 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; }