summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2010-11-05 21:43:19 +0000
committerJohnny Chen <johnny.chen@apple.com>2010-11-05 21:43:19 +0000
commit76c381b6f5b1249027e084f63375ee10ff121bba (patch)
tree72dab570d6eafd87b495bade8a22b6870a1853ec
parent16443fdd31f47577aa53b4997222413112088bc7 (diff)
downloadbcm5719-llvm-76c381b6f5b1249027e084f63375ee10ff121bba.tar.gz
bcm5719-llvm-76c381b6f5b1249027e084f63375ee10ff121bba.zip
Fix the infinite recursion crash reported by Antoine Missout:
rdar://problem/8557095 lldb disas crashed (from lldb developer) llvm-svn: 118299
-rw-r--r--lldb/source/Symbol/ObjectFile.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lldb/source/Symbol/ObjectFile.cpp b/lldb/source/Symbol/ObjectFile.cpp
index 8c0ffceb65e..1dbea48a2b2 100644
--- a/lldb/source/Symbol/ObjectFile.cpp
+++ b/lldb/source/Symbol/ObjectFile.cpp
@@ -59,6 +59,11 @@ ObjectFile::FindPlugin (Module* module, const FileSpec* file, lldb::addr_t file_
}
}
+ // No need to delegate further if (file_offset, file_size) exceeds the total file size.
+ // This is the base case.
+ if (file_offset + file_size > file->GetByteSize())
+ return NULL;
+
DataBufferSP file_header_data_sp(file->ReadFileContents(file_offset, 512));
uint32_t idx;
OpenPOWER on IntegriCloud