[Lldb-commits] [lldb] r296733 - x86AssemblyInspectionEngine::AugmentUnwindPlanFromCallSite could access

Jason Molenda via lldb-commits lldb-commits at lists.llvm.org
Wed Mar 1 21:08:11 PST 2017


Author: jmolenda
Date: Wed Mar  1 23:08:10 2017
New Revision: 296733

URL: http://llvm.org/viewvc/llvm-project?rev=296733&view=rev
Log:
x86AssemblyInspectionEngine::AugmentUnwindPlanFromCallSite could access
the byte past the end of the buffer it had been given.  ASAN catch.
<rdar://problem/30774863> 

Modified:
    lldb/trunk/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp

Modified: lldb/trunk/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp?rev=296733&r1=296732&r2=296733&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp (original)
+++ lldb/trunk/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp Wed Mar  1 23:08:10 2017
@@ -979,11 +979,12 @@ bool x86AssemblyInspectionEngine::Augmen
     offset += insn_len;
     m_cur_insn = data + offset;
 
-    if (reinstate_unwind_state) {
-      // that was the last instruction of this function
-      if (offset >= size)
-        continue;
+    // offset is pointing beyond the bounds of the
+    // function; stop looping.
+    if (offset >= size) 
+      continue;
 
+    if (reinstate_unwind_state) {
       UnwindPlan::RowSP new_row(new UnwindPlan::Row());
       *new_row = *original_last_row;
       new_row->SetOffset(offset);




More information about the lldb-commits mailing list