Make sure that the string table size is not smaller than 6 (and also
not larger than SIZE_MAX for better 32 bit support).
Such small values would lead to a large loop limit which either leads to
a crash or wrong detection of a ".data" string in possibly uninitialized
memory.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
strtab_size = (*dec32)(
h + e_shstrndx * e_shentsize + 0x14);
}
+ if (strtab_size < 6 || strtab_size > SIZE_MAX)
+ break;
/*
* Read the STRTAB section to find the .data offset