From 76cb4bc841dc2d0e808aeb7fcf2f37c844a1b26e Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 26 Dec 2017 15:49:19 -0800 Subject: Cleanup: avoid out of bounds access sizeof() is clearly the wrong way to get to the size of that array... Coverity CID 208294 Signed-off-by: Dirk Hohndel --- core/uemis-downloader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/uemis-downloader.c b/core/uemis-downloader.c index 023ac8eaa..53aa6dada 100644 --- a/core/uemis-downloader.c +++ b/core/uemis-downloader.c @@ -882,7 +882,7 @@ static bool process_raw_buffer(device_data_t *devdata, uint32_t deviceid, char * #if UEMIS_DEBUG & 4 fprintf(debugfile, "Expect to find section %s\n", sections[nr_sections]); #endif - if (nr_sections < sizeof(sections) - 1) + if (nr_sections < sizeof(sections) / sizeof(*sections) - 1) nr_sections++; continue; } -- cgit v1.2.3-70-g09d2