aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Support/VirtualFileSystemTest.cpp
diff options
context:
space:
mode:
authorGeorgii Rymar <grimar@accesssoftek.com>2020-06-03 18:19:05 +0300
committerGeorgii Rymar <grimar@accesssoftek.com>2020-06-04 12:00:44 +0300
commit2ad0ef6ef19dd1678e05b6d219ea0fdd4853bb64 (patch)
treea00f779763fc6d152f8aee2c5a4adc7ae86f6d69 /llvm/unittests/Support/VirtualFileSystemTest.cpp
parent06cf7adcc88178f887984fa74cdefb20cd8cd124 (diff)
downloadllvm-2ad0ef6ef19dd1678e05b6d219ea0fdd4853bb64.zip
llvm-2ad0ef6ef19dd1678e05b6d219ea0fdd4853bb64.tar.gz
llvm-2ad0ef6ef19dd1678e05b6d219ea0fdd4853bb64.tar.bz2
[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
Diffstat (limited to 'llvm/unittests/Support/VirtualFileSystemTest.cpp')
0 files changed, 0 insertions, 0 deletions