From 8550ddb2eac9677d27ea215880a5495e6e6e59ac Mon Sep 17 00:00:00 2001 From: Ed Maste Date: Sun, 26 Jul 2020 15:10:33 +0000 Subject: 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 --- bin/chio/chio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/chio/chio.c b/bin/chio/chio.c index 5a2a7ba215c33..3264db8bb18da 100644 --- a/bin/chio/chio.c +++ b/bin/chio/chio.c @@ -1144,7 +1144,7 @@ find_element(char *voltag, uint16_t *et, uint16_t *eu) /* * Now search the list the specified */ - for (elem = 0; elem <= total_elem; ++elem) { + for (elem = 0; elem < total_elem; ++elem) { ces = &ch_ces[elem]; -- cgit v1.2.3