svn commit: r301556 - stable/10/sbin/ifconfig

Don Lewis truckman at FreeBSD.org
Tue Jun 7 16:53:06 UTC 2016


Author: truckman
Date: Tue Jun  7 16:53:05 2016
New Revision: 301556
URL: https://svnweb.freebsd.org/changeset/base/301556

Log:
  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

Modified:
  stable/10/sbin/ifconfig/ifieee80211.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sbin/ifconfig/ifieee80211.c
==============================================================================
--- stable/10/sbin/ifconfig/ifieee80211.c	Tue Jun  7 16:51:56 2016	(r301555)
+++ stable/10/sbin/ifconfig/ifieee80211.c	Tue Jun  7 16:53:05 2016	(r301556)
@@ -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)


More information about the svn-src-stable mailing list