diff mbox

airo: Read buffer overflow

Message ID 4A753EDE.9030506@gmail.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Roel Kluin Aug. 2, 2009, 7:23 a.m. UTC
Check whether index is within bounds before testing the element.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Roel Kluin Aug. 2, 2009, 7:49 a.m. UTC | #1
Op 02-08-09 09:23, Roel Kluin schreef:
> Check whether index is within bounds before testing the element.

Please ignore, I already sent this, sorry.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index c70604f..e8ac4d9 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -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;