diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/binary-reader-objdump.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/binary-reader-objdump.cc b/src/binary-reader-objdump.cc index cc874a26..66c858ed 100644 --- a/src/binary-reader-objdump.cc +++ b/src/binary-reader-objdump.cc @@ -175,6 +175,12 @@ void BinaryReaderObjdumpBase::PrintRelocation(const Reloc& reloc, } Result BinaryReaderObjdumpBase::OnRelocCount(Index count, Index section_index) { + if (section_index >= section_types_.size()) { + fprintf(stderr, "invalid relocation section index: %" PRIindex "\n", + section_index); + reloc_section_ = BinarySection::Invalid; + return Result::Error; + } reloc_section_ = section_types_[section_index]; return Result::Ok; } |