diff options
author | truckman <truckman@FreeBSD.org> | 2016-05-16 08:07:32 +0000 |
---|---|---|
committer | truckman <truckman@FreeBSD.org> | 2016-05-16 08:07:32 +0000 |
commit | 6dbdca5ddae3f2062e3e473a047b5b90947898c6 (patch) | |
tree | 958d8081921b02210c372ee9972bb3b3e357c6a9 /sbin | |
parent | 38baa8af3db22812359cb5b190f0692ca2b48ce8 (diff) | |
download | FreeBSD-src-6dbdca5ddae3f2062e3e473a047b5b90947898c6.zip FreeBSD-src-6dbdca5ddae3f2062e3e473a047b5b90947898c6.tar.gz |
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
MFC after: 3 weeks
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/ifconfig/ifieee80211.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sbin/ifconfig/ifieee80211.c b/sbin/ifconfig/ifieee80211.c index c0c61d9..1e1e498 100644 --- a/sbin/ifconfig/ifieee80211.c +++ b/sbin/ifconfig/ifieee80211.c @@ -3753,6 +3753,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) |