summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwain Ainsworth <oga@cvs.openbsd.org>2009-12-10 21:04:17 +0000
committerOwain Ainsworth <oga@cvs.openbsd.org>2009-12-10 21:04:17 +0000
commitf3d337bc9e9b86de5ea2f5505aa21461f404dd2b (patch)
tree91b11c2e817c5c2cb5a1a35effdacdef2b9696e9
parent23d528119fdd6605e9993e9505b7c5d1528bedc9 (diff)
"please apply the same diff as for rt2860 to if_run.c" damien@
original log message: 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
-rw-r--r--sys/dev/usb/if_run.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/usb/if_run.c b/sys/dev/usb/if_run.c
index 5b2f063926a..f2d9e4212c2 100644
--- a/sys/dev/usb/if_run.c
+++ b/sys/dev/usb/if_run.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_run.c,v 1.34 2009/11/17 20:13:42 damien Exp $ */
+/* $OpenBSD: if_run.c,v 1.35 2009/12/10 21:04:16 oga Exp $ */
/*-
* Copyright (c) 2008,2009 Damien Bergamini <damien.bergamini@free.fr>
@@ -1747,7 +1747,7 @@ run_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;