[llvm-readelf] - Do not try to read past the end of the file when dumping the the SHT_GNU_HASH.
We have unobvious issue in the condition that is used to check that we do not read past the EOF. The problem is that the result of "GnuHashTable->nbuckets * 4" expression is uint32. Because of that it was still possible to overflow it and pass the check. There was no such problem with the "GnuHashTable->maskwords * sizeof(typename ELFT::Off)" condition, because of `sizeof` on the right (which gives 64-bits value on x64), but I've added an explicit conversion to 64-bit value for `GnuHashTable->maskwords` too. Differential revision: https://reviews.llvm.org/D81103
Loading
Please register or sign in to comment