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:
Ed Maste 2020-07-26 15:10:33 +00:00
parent 29f25856a4
commit 8550ddb2ea

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