summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authortruckman <truckman@FreeBSD.org>2016-06-07 16:53:05 +0000
committertruckman <truckman@FreeBSD.org>2016-06-07 16:53:05 +0000
commit1d7291afd1c4e47d4446eeb61ef3890d158230c2 (patch)
tree7fc2de76f3220b2a5938dad53eb39a8b6e900bbf /sbin
parent223f7999b212496988916be99bfbd4e5f9543507 (diff)
downloadFreeBSD-src-1d7291afd1c4e47d4446eeb61ef3890d158230c2.zip
FreeBSD-src-1d7291afd1c4e47d4446eeb61ef3890d158230c2.tar.gz
MFC r299921
Add an assertion to catch a potential underflow in an array index calculation, though this should not happen in the current code. Reported by: Coverity CID: 1008486
Diffstat (limited to 'sbin')
-rw-r--r--sbin/ifconfig/ifieee80211.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sbin/ifconfig/ifieee80211.c b/sbin/ifconfig/ifieee80211.c
index 1103215..e80fb98 100644
--- a/sbin/ifconfig/ifieee80211.c
+++ b/sbin/ifconfig/ifieee80211.c
@@ -3626,6 +3626,7 @@ list_txpow(int s)
/* suppress duplicates as above */
if (isset(reported, c->ic_ieee) && !verbose) {
/* XXX we assume duplicates are adjacent */
+ assert(achans->ic_nchans > 0);
prev = &achans->ic_chans[achans->ic_nchans-1];
/* display highest power on channel */
if (c->ic_maxpower > prev->ic_maxpower)
OpenPOWER on IntegriCloud