From 5b8a31459b7274faf97d22179eadc5afee8a219e Mon Sep 17 00:00:00 2001 From: Ed Maste Date: Wed, 30 Sep 2020 19:23:25 +0000 Subject: [PATCH] MFC r363563: 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(-) diff --git a/bin/chio/chio.c b/bin/chio/chio.c index 5a2a7ba215c..3264db8bb18 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]; -- 2.45.0