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];
 
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to