Author: bryanpkc
Date: Wed May  4 12:24:31 2016
New Revision: 268520

URL: http://llvm.org/viewvc/llvm-project?rev=268520&view=rev
Log:
Fix a SIGSEGV caused by dereferencing a pointer without a null check

Modified:
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp?rev=268520&r1=268519&r2=268520&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp Wed May  4 
12:24:31 2016
@@ -943,7 +943,7 @@ DWARFCompileUnit::IndexPrivate (DWARFCom
                     // as our name. If it starts with '_', then it is ok, else 
compare
                     // the string to make sure it isn't the same and we don't 
end up
                     // with duplicate entries
-                    if (name != mangled_cstr && ((mangled_cstr[0] == '_') || 
(name && ::strcmp(name, mangled_cstr) != 0)))
+                    if (name && name != mangled_cstr && ((mangled_cstr[0] == 
'_') || (::strcmp(name, mangled_cstr) != 0)))
                     {
                         Mangled mangled (ConstString(mangled_cstr), true);
                         func_fullnames.Insert (mangled.GetMangledName(), 
DIERef(cu_offset, die.GetOffset()));
@@ -966,7 +966,7 @@ DWARFCompileUnit::IndexPrivate (DWARFCom
                     // as our name. If it starts with '_', then it is ok, else 
compare
                     // the string to make sure it isn't the same and we don't 
end up
                     // with duplicate entries
-                    if (name != mangled_cstr && ((mangled_cstr[0] == '_') || 
(::strcmp(name, mangled_cstr) != 0)))
+                    if (name && name != mangled_cstr && ((mangled_cstr[0] == 
'_') || (::strcmp(name, mangled_cstr) != 0)))
                     {
                         Mangled mangled (ConstString(mangled_cstr), true);
                         func_fullnames.Insert (mangled.GetMangledName(), 
DIERef(cu_offset, die.GetOffset()));


_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to