summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorOwain Ainsworth <oga@cvs.openbsd.org>2009-12-10 21:01:30 +0000
committerOwain Ainsworth <oga@cvs.openbsd.org>2009-12-10 21:01:30 +0000
commit23d528119fdd6605e9993e9505b7c5d1528bedc9 (patch)
treeb7ad06561b3abb444497f91cf4aaf8f5bb73f124 /sys
parent61cdd4aabad435aaf180cbd20653376e5cf8d398 (diff)
fix a theoretical (but not possible) array bound overflow.
since we will always match on a rate, we won't overflow, but in that case, make it more obvious by if the first 11 rates don't match, we assume the 12th. should shut up parfait. ok damien@ who came up with an identical diff.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/rt2860.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/ic/rt2860.c b/sys/dev/ic/rt2860.c
index 102aab656c8..adb96293786 100644
--- a/sys/dev/ic/rt2860.c
+++ b/sys/dev/ic/rt2860.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rt2860.c,v 1.37 2009/11/03 17:36:58 damien Exp $ */
+/* $OpenBSD: rt2860.c,v 1.38 2009/12/10 21:01:29 oga Exp $ */
/*-
* Copyright (c) 2007, 2008
@@ -789,7 +789,7 @@ rt2860_newassoc(struct ieee80211com *ic, struct ieee80211_node *ni, int isnew)
for (i = 0; i < rs->rs_nrates; i++) {
rate = rs->rs_rates[i] & IEEE80211_RATE_VAL;
/* convert 802.11 rate to hardware rate index */
- for (ridx = 0; ridx <= RT2860_RIDX_MAX; ridx++)
+ for (ridx = 0; ridx < RT2860_RIDX_MAX; ridx++)
if (rt2860_rates[ridx].rate == rate)
break;
rn->ridx[i] = ridx;