linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: r8188eu: Prevent infinite loop
@ 2022-08-14 17:44 Larry Finger
  2022-08-15  6:28 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Larry Finger @ 2022-08-14 17:44 UTC (permalink / raw)
  To: gregkh; +Cc: phil, linux-staging, linux-kernel, linux-wireless, Larry Finger

---
 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] staging: r8188eu: Prevent infinite loop
  2022-08-14 17:44 [PATCH] staging: r8188eu: Prevent infinite loop Larry Finger
@ 2022-08-15  6:28 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2022-08-15  6:28 UTC (permalink / raw)
  To: Larry Finger; +Cc: phil, linux-staging, linux-kernel, linux-wireless

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?

:(

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-08-15  6:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-14 17:44 [PATCH] staging: r8188eu: Prevent infinite loop Larry Finger
2022-08-15  6:28 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).