diff options
Diffstat (limited to 'llvm/tools/llvm-readobj/COFFDumper.cpp')
-rw-r--r-- | llvm/tools/llvm-readobj/COFFDumper.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/tools/llvm-readobj/COFFDumper.cpp b/llvm/tools/llvm-readobj/COFFDumper.cpp index a216a05e96f..029674b8d63 100644 --- a/llvm/tools/llvm-readobj/COFFDumper.cpp +++ b/llvm/tools/llvm-readobj/COFFDumper.cpp @@ -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 |