mirror of
https://github.com/intel/llvm.git
synced 2026-01-20 01:58:44 +08:00
Fix heap-buffer-overflow bugs identified by the Address Sanitizer
Differential Revision: http://reviews.llvm.org/D7733 llvm-svn: 229912
This commit is contained in:
@@ -142,6 +142,8 @@ uint32_t ArchHandler::readU32(const uint8_t *addr, bool isBig) {
|
||||
|
||||
bool ArchHandler::isDwarfCIE(bool isBig, const DefinedAtom *atom) {
|
||||
assert(atom->contentType() == DefinedAtom::typeCFI);
|
||||
if (atom->rawContent().size() < sizeof(uint32_t))
|
||||
return false;
|
||||
uint32_t size = read32(atom->rawContent().data(), isBig);
|
||||
|
||||
uint32_t idOffset = sizeof(uint32_t);
|
||||
|
||||
@@ -411,6 +411,9 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
if (atom->rawContent().size() < 4 * sizeof(uint32_t))
|
||||
return entry;
|
||||
|
||||
using normalized::read32;
|
||||
entry.rangeLength =
|
||||
read32(atom->rawContent().data() + 2 * sizeof(uint32_t), _isBig);
|
||||
|
||||
Reference in New Issue
Block a user