diff options
Diffstat (limited to 'results/scraper/box64/1493')
| -rw-r--r-- | results/scraper/box64/1493 | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/results/scraper/box64/1493 b/results/scraper/box64/1493 new file mode 100644 index 000000000..e82524507 --- /dev/null +++ b/results/scraper/box64/1493 @@ -0,0 +1,19 @@ +Maybe a mistake in ELF parser +I know it +```c++ +https://github.com/ptitSeb/box64/blob/main/src/elfs/elfparser.c#L125 +elfheader_t *h = box_calloc(1, sizeof(elfheader_t)); +// ... +h->numSHEntries = header.e_shnum; +// ... +if(header.e_shentsize && header.e_shnum) { + // special cases for nums + if(h->numSHEntries == 0) { // THIS BRANCH IS IMPOSSIBLE TO BE EXECUTED!!! + printf_dump(LOG_DEBUG, "Read number of Sections in 1st Section\n"); + // read 1st section header and grab actual number from here + // ... + h->numSHEntries = section.sh_size; + } +} +``` +`h->numSHEntries` has been stored with value of `e_shnum`, only when `e_shnum` is non-zero will the outter branch be executed, then the `h->numSHEntries` must be non-zero as well, then the inner branch will never be executed. \ No newline at end of file |