[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220814174404.25923-1-Larry.Finger@lwfinger.net>
Date: Sun, 14 Aug 2022 12:44:04 -0500
From: Larry Finger <Larry.Finger@...inger.net>
To: gregkh@...uxfoundation.org
Cc: phil@...lpotter.co.uk, linux-staging@...ts.linux.dev,
linux-kernel@...r.kernel.org, linux-wireless@...r.kernel.org,
Larry Finger <Larry.Finger@...inger.net>
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
Powered by blists - more mailing lists