Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/ic Fix array overflow, found by gcc -O3.
details: https://anonhg.NetBSD.org/src/rev/923a026afa60
branches: trunk
changeset: 778087:923a026afa60
user: bouyer <bouyer%NetBSD.org@localhost>
date: Thu Mar 15 18:34:40 2012 +0000
description:
Fix array overflow, found by gcc -O3.
diffstat:
sys/dev/ic/bwi.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diffs (27 lines):
diff -r d57d6a6a2b3a -r 923a026afa60 sys/dev/ic/bwi.c
--- a/sys/dev/ic/bwi.c Thu Mar 15 18:22:30 2012 +0000
+++ b/sys/dev/ic/bwi.c Thu Mar 15 18:34:40 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bwi.c,v 1.18 2011/10/10 11:15:24 njoly Exp $ */
+/* $NetBSD: bwi.c,v 1.19 2012/03/15 18:34:40 bouyer Exp $ */
/* $OpenBSD: bwi.c,v 1.74 2008/02/25 21:13:30 mglocker Exp $ */
/*
@@ -48,7 +48,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bwi.c,v 1.18 2011/10/10 11:15:24 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bwi.c,v 1.19 2012/03/15 18:34:40 bouyer Exp $");
#include <sys/param.h>
#include <sys/callout.h>
@@ -3595,7 +3595,7 @@
bwi_tbl_write_2(mac, BWI_PHYTBL_RSSI + i, i);
/* Fill noise table */
- for (i = 0; i < sizeof(bwi_phy_noise_11g); ++i) {
+ for (i = 0; i < __arraycount(bwi_phy_noise_11g); ++i) {
bwi_tbl_write_2(mac, BWI_PHYTBL_NOISE + i,
bwi_phy_noise_11g[i]);
}
Home |
Main Index |
Thread Index |
Old Index