mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-15 07:59:57 +00:00
[COFFDumper] Validate that the next offset is not too large
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271147 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
03348eaac6
commit
52b8c95368
@ -736,6 +736,8 @@ void COFFDumper::printCodeViewSymbolSection(StringRef SectionName,
|
||||
size_t SectionOffset = Data.data() - SectionContents.data();
|
||||
size_t NextOffset = SectionOffset + SubSectionSize;
|
||||
NextOffset = alignTo(NextOffset, 4);
|
||||
if (NextOffset > SectionContents.size())
|
||||
return error(object_error::parse_failed);
|
||||
Data = SectionContents.drop_front(NextOffset);
|
||||
|
||||
// Optionally print the subsection bytes in case our parsing gets confused
|
||||
|
Loading…
Reference in New Issue
Block a user