From bc7ddae23425cee8999e4e8ed61f77a62f058cbf Mon Sep 17 00:00:00 2001 From: Joshua Peraza Date: Mon, 9 Aug 2021 16:19:46 -0700 Subject: [PATCH] Don't count str_offsets_table header size before DWARF 5 The header is not present in earlier versions of split dwarf. Change-Id: I8fde233268230cea157b2b3276f3cf05190962f2 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3083253 Reviewed-by: Sterling Augustine --- src/common/dwarf/dwarf2reader.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/dwarf/dwarf2reader.cc b/src/common/dwarf/dwarf2reader.cc index 5850fb7c..aa4ec2b6 100644 --- a/src/common/dwarf/dwarf2reader.cc +++ b/src/common/dwarf/dwarf2reader.cc @@ -457,7 +457,7 @@ void CompilationUnit::ProcessFormStringIndex( uint64_t dieoffset, enum DwarfAttribute attr, enum DwarfForm form, uint64_t str_index) { const size_t kStringOffsetsTableHeaderSize = - reader_->OffsetSize() == 8 ? 16 : 8; + header_.version >= 5 ? (reader_->OffsetSize() == 8 ? 16 : 8) : 0; const uint8_t* str_offsets_table_after_header = str_offsets_base_ ? str_offsets_buffer_ + str_offsets_base_ : str_offsets_buffer_ + kStringOffsetsTableHeaderSize;