linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ath9k: Prevent read buffer overflow
@ 2009-08-11 18:40 Roel Kluin
  2009-08-12 11:58 ` Vasanthakumar Thiagarajan
  0 siblings, 1 reply; 4+ messages in thread
From: Roel Kluin @ 2009-08-11 18:40 UTC (permalink / raw)
  To: Luis R. Rodriguez, linux-wireless, ath9k-devel, Andrew Morton

Prevent a read from valid_rate_index[] with a negative index

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
Maybe we should add this?

diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c
index ba06e78..a67b7f6 100644
--- a/drivers/net/wireless/ath/ath9k/rc.c
+++ b/drivers/net/wireless/ath/ath9k/rc.c
@@ -1458,7 +1458,7 @@ static void ath_rc_init(struct ath_softc *sc,
 		ath_rc_priv->rate_max_phy = ath_rc_priv->valid_phy_rateidx[i][j-1];
 	}
 	ASSERT(ath_rc_priv->rate_table_size <= RATE_TABLE_SIZE);
-	ASSERT(k <= RATE_TABLE_SIZE);
+	ASSERT(k <= RATE_TABLE_SIZE && k >= 4);
 
 	ath_rc_priv->max_valid_rate = k;
 	ath_rc_sort_validrates(rate_table, ath_rc_priv);

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-08-12 12:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-11 18:40 [PATCH] ath9k: Prevent read buffer overflow Roel Kluin
2009-08-12 11:58 ` Vasanthakumar Thiagarajan
2009-08-12 12:35   ` roel kluin
2009-08-12 12:42     ` Vasanthakumar Thiagarajan

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).