From: Roel Kluin Date: Sun, 2 Aug 2009 07:44:12 +0000 (+0200) Subject: libertas: Read buffer overflow X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b929c633b4067be18a335d278a66fd5deef3cabe;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git libertas: Read buffer overflow Check whether index is within bounds before testing the element. Signed-off-by: Roel Kluin Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/libertas/11d.c b/drivers/net/wireless/libertas/11d.c index 9a5408e7d94a..5c6968101f0d 100644 --- a/drivers/net/wireless/libertas/11d.c +++ b/drivers/net/wireless/libertas/11d.c @@ -47,7 +47,7 @@ static u8 lbs_region_2_code(u8 *region) { u8 i; - for (i = 0; region[i] && i < COUNTRY_CODE_LEN; i++) + for (i = 0; i < COUNTRY_CODE_LEN && region[i]; i++) region[i] = toupper(region[i]); for (i = 0; i < ARRAY_SIZE(region_code_mapping); i++) {