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
This commit is contained in:
emaste 2020-07-26 15:10:33 +00:00
parent 21e60a6cf1
commit f3da171642

View File

@ -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];