2022-08-14 17:59:32

by Larry Finger

[permalink] [raw]
Subject: [PATCH] staging: r8188eu: Prevent infinite loop

---
drivers/staging/r8188eu/core/rtw_ieee80211.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/staging/r8188eu/core/rtw_ieee80211.c b/drivers/staging/r8188eu/core/rtw_ieee80211.c
index bc8543ea2e66..0a5f08427385 100644
--- a/drivers/staging/r8188eu/core/rtw_ieee80211.c
+++ b/drivers/staging/r8188eu/core/rtw_ieee80211.c
@@ -531,6 +531,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_max = 0;

if (wps_ielen)
*wps_ielen = 0;
@@ -557,6 +558,8 @@ u8 *rtw_get_wps_ie(u8 *in_ie, uint in_len, u8 *wps_ie, uint *wps_ielen)
break;
}
cnt += in_ie[cnt + 1] + 2; /* goto next */
+ if (++loop > 1000)
+ return NULL;
}
return wpsie_ptr;
}
--
2.37.1


2022-08-15 06:31:19

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH] staging: r8188eu: Prevent infinite loop

On Sun, Aug 14, 2022 at 12:44:04PM -0500, Larry Finger wrote:
> ---
> drivers/staging/r8188eu/core/rtw_ieee80211.c | 3 +++
> 1 file changed, 3 insertions(+)

No changelog or signed-off-by?

:(