[Lldb-commits] [lldb] r251583 - Fix potential null deref; after SymbolContextSpecifier::SymbolContextMatches

Jason Molenda via lldb-commits lldb-commits at lists.llvm.org
Wed Oct 28 16:49:55 PDT 2015


Author: jmolenda
Date: Wed Oct 28 18:49:55 2015
New Revision: 251583

URL: http://llvm.org/viewvc/llvm-project?rev=251583&view=rev
Log:
Fix potential null deref; after SymbolContextSpecifier::SymbolContextMatches
has tested that sc.function is null, it would try to deref sc.function.
It should be calling sc.symbol here.

Modified:
    lldb/trunk/source/Symbol/SymbolContext.cpp

Modified: lldb/trunk/source/Symbol/SymbolContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/SymbolContext.cpp?rev=251583&r1=251582&r2=251583&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/SymbolContext.cpp (original)
+++ lldb/trunk/source/Symbol/SymbolContext.cpp Wed Oct 28 18:49:55 2015
@@ -1089,7 +1089,7 @@ SymbolContextSpecifier::SymbolContextMat
             }
             else if (sc.symbol != nullptr)
             {
-                if (!sc.symbol->GetMangled().NameMatches(func_name, sc.function->GetLanguage()))
+                if (!sc.symbol->GetMangled().NameMatches(func_name, sc.symbol->GetLanguage()))
                     return false;
             }
         }




More information about the lldb-commits mailing list