Skip to contentSkip to conversation

libertas: Read buffer overflow

PATCH In review Roel Kluin 2 participants 2 messages Aug 2, 2009 – Aug 4, 2009 Networking drivers (wireless)

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 libertas: Read buffer overflow

Check whether index is within bounds before testing the element.

---

drivers/net/wireless/libertas/11d.c +1 -1
index 9a5408e..5c69681 100644
@@ -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++) {
Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines · Roel Kluin

Check whether index is within bounds before testing the element.

Quoted 18 lines

---

drivers/net/wireless/libertas/11d.c +1 -2
index 9a5408e..5c69681 100644
@@ -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++) {
--

To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html