Skip to contentSkip to conversation

airo: Read buffer overflow

PATCH In review Roel Kluin 1 participant 2 messages Aug 2, 2009 Networking drivers (wireless)

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 airo: Read buffer overflow

Check whether index is within bounds before testing the element.

---

drivers/net/wireless/airo.c +1 -1
index c70604f..e8ac4d9 100644
@@ -6819,7 +6819,7 @@ static int airo_set_txpow(struct net_device *dev,
 		return -EINVAL;
 	}
 	clear_bit (FLAG_RADIO_OFF, &local->flags);
-	for (i = 0; cap_rid.txPowerLevels[i] && (i < 8); i++)
+	for (i = 0; i < 8 && cap_rid.txPowerLevels[i]; i++)
 		if (v == cap_rid.txPowerLevels[i]) {
 			readConfigRid(local, 1);
 			local->config.txPower = v;
author
#1 lore raw

Op 02-08-09 09:23, Roel Kluin schreef:

Quoted 1 line

Check whether index is within bounds before testing the element.

Please ignore, I already sent this, sorry.