diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2017-12-26 15:49:19 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-12-26 16:06:05 -0800 |
commit | 76cb4bc841dc2d0e808aeb7fcf2f37c844a1b26e (patch) | |
tree | ed2250bef40fa7c575d797036a02c894224089c3 /core/uemis-downloader.c | |
parent | 04bca45552b59441e41dbf4e66cb8b7ce9baa021 (diff) | |
download | subsurface-76cb4bc841dc2d0e808aeb7fcf2f37c844a1b26e.tar.gz |
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 <dirk@hohndel.org>
Diffstat (limited to 'core/uemis-downloader.c')
-rw-r--r-- | core/uemis-downloader.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; } |