* [PATCH] airo: Read buffer overflow
@ 2009-08-02 7:23 Roel Kluin
2009-08-02 7:49 ` Roel Kluin
0 siblings, 1 reply; 2+ messages in thread
From: Roel Kluin @ 2009-08-02 7:23 UTC (permalink / raw)
To: linville, linux-wireless, Andrew Morton
Check whether index is within bounds before testing the element.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
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;
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-08-02 7:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-02 7:23 [PATCH] airo: Read buffer overflow Roel Kluin
2009-08-02 7:49 ` Roel Kluin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).