aboutsummaryrefslogtreecommitdiff
path: root/src/common/mac
diff options
context:
space:
mode:
authorladderbreaker <ladderbreaker@4c0a9323-5329-0410-9bdc-e9ce6186880e>2007-06-06 20:49:48 +0000
committerladderbreaker <ladderbreaker@4c0a9323-5329-0410-9bdc-e9ce6186880e>2007-06-06 20:49:48 +0000
commit2e86dfe70513091a0fb8f5725a4c81c476f993e8 (patch)
tree1380bd012c91d0da02bbb046495928a57dff42b2 /src/common/mac
parentIssue 42 - check for non-existent dump file in HTTPUpload::SendRequest. r=br... (diff)
downloadbreakpad-2e86dfe70513091a0fb8f5725a4c81c476f993e8.tar.xz
issue 154: reviewed by Waylonis
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@187 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/common/mac')
-rw-r--r--src/common/mac/macho_id.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/common/mac/macho_id.cc b/src/common/mac/macho_id.cc
index c45329ed..728bd47e 100644
--- a/src/common/mac/macho_id.cc
+++ b/src/common/mac/macho_id.cc
@@ -275,7 +275,11 @@ bool MachoID::WalkerCB(MachoWalker *walker, load_command *cmd, off_t offset,
if (swap)
swap_section(&sec, 1, NXHostByteOrder());
- macho_id->Update(walker, header_offset + sec.offset, sec.size);
+ // sections of type S_ZEROFILL are "virtual" and contain no data
+ // in the file itself
+ if ((sec.flags & SECTION_TYPE) != S_ZEROFILL && sec.offset != 0)
+ macho_id->Update(walker, header_offset + sec.offset, sec.size);
+
offset += sizeof(struct section);
}
} else if (cmd->cmd == LC_SEGMENT_64) {
@@ -304,7 +308,11 @@ bool MachoID::WalkerCB(MachoWalker *walker, load_command *cmd, off_t offset,
if (swap)
breakpad_swap_section_64(&sec64, 1, NXHostByteOrder());
- macho_id->Update(walker, header_offset + sec64.offset, sec64.size);
+ // sections of type S_ZEROFILL are "virtual" and contain no data
+ // in the file itself
+ if ((sec64.flags & SECTION_TYPE) != S_ZEROFILL && sec64.offset != 0)
+ macho_id->Update(walker, header_offset + sec64.offset, sec64.size);
+
offset += sizeof(struct section_64);
}
}