aboutsummaryrefslogtreecommitdiff
path: root/src/common/dwarf/dwarf2reader.cc
diff options
context:
space:
mode:
authorDave MacLachlan <dmaclach@google.com>2016-05-11 14:10:23 -0700
committerDave MacLachlan <dmaclach@google.com>2016-05-11 14:10:23 -0700
commit1bbe2f29c966242ee86d4a856418b1317637c916 (patch)
tree1ea245a8cb2fb6dd03611d86a11ec3f81313a7aa /src/common/dwarf/dwarf2reader.cc
parentbreakpad: fix unittest errors (diff)
downloadbreakpad-1bbe2f29c966242ee86d4a856418b1317637c916.tar.xz
Update to handle dsym files that end with a header.
dsym files generated by Xcode for swift (Xcode 7.3) end with a header, and the code did not handle that case. BUG=https://bugs.chromium.org/p/google-breakpad/issues/detail?id=689 R=ivanpe@chromium.org Review URL: https://codereview.chromium.org/1971793002 .
Diffstat (limited to 'src/common/dwarf/dwarf2reader.cc')
-rw-r--r--src/common/dwarf/dwarf2reader.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/common/dwarf/dwarf2reader.cc b/src/common/dwarf/dwarf2reader.cc
index 003ed7b1..dc0e2349 100644
--- a/src/common/dwarf/dwarf2reader.cc
+++ b/src/common/dwarf/dwarf2reader.cc
@@ -266,7 +266,9 @@ void CompilationUnit::ReadHeader() {
header_.abbrev_offset = reader_->ReadOffset(headerptr);
headerptr += reader_->OffsetSize();
- assert(headerptr + 1 < buffer_ + buffer_length_);
+ // Compare against less than or equal because this may be the last
+ // section in the file.
+ assert(headerptr + 1 <= buffer_ + buffer_length_);
header_.address_size = reader_->ReadOneByte(headerptr);
reader_->SetAddressSize(header_.address_size);
headerptr += 1;