Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 Jul 2020 15:10:33 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r363563 - head/bin/chio
Message-ID:  <202007261510.06QFAXZV012913@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: emaste
Date: Sun Jul 26 15:10:33 2020
New Revision: 363563
URL: https://svnweb.freebsd.org/changeset/base/363563

Log:
  chio: avoid out of bounds read
  
  ch_ces is alloacated with space for total_elem entries.
  
  CID:		1418536
  Reported by:	Coverity Scan
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/bin/chio/chio.c

Modified: head/bin/chio/chio.c
==============================================================================
--- head/bin/chio/chio.c	Sun Jul 26 13:30:33 2020	(r363562)
+++ head/bin/chio/chio.c	Sun Jul 26 15:10:33 2020	(r363563)
@@ -1144,7 +1144,7 @@ find_element(char *voltag, uint16_t *et, uint16_t *eu)
 	/*
 	 * Now search the list the specified <voltag>
 	 */	
-	for (elem = 0; elem <= total_elem; ++elem) {
+	for (elem = 0; elem < total_elem; ++elem) {
 
 		ces = &ch_ces[elem];
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202007261510.06QFAXZV012913>