mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
04bca45552
commit
76cb4bc841
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue