aboutsummaryrefslogtreecommitdiff
path: root/src/common/mac
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/mac')
-rw-r--r--src/common/mac/macho_walker.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/common/mac/macho_walker.cc b/src/common/mac/macho_walker.cc
index 26535bc2..92da7b1f 100644
--- a/src/common/mac/macho_walker.cc
+++ b/src/common/mac/macho_walker.cc
@@ -105,9 +105,11 @@ bool MachoWalker::WalkHeader(int cpu_type) {
bool MachoWalker::ReadBytes(void *buffer, size_t size, off_t offset) {
if (memory_) {
+ if (offset < 0)
+ return false;
bool result = true;
if (offset + size > memory_size_) {
- if (offset >= memory_size_)
+ if (static_cast<size_t>(offset) >= memory_size_)
return false;
size = memory_size_ - offset;
result = false;