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>
This commit is contained in:
Dirk Hohndel 2017-12-26 15:49:19 -08:00
parent 04bca45552
commit 76cb4bc841

View file

@ -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;
}