[Lldb-commits] [lldb] r231048 - Fix a crasher where we might have a N_UNDF symbol with no name and this could cause ObjectFileMachO::ParseSymtab() to crash.

Greg Clayton gclayton at apple.com
Mon Mar 2 17:40:46 PST 2015


Author: gclayton
Date: Mon Mar  2 19:40:46 2015
New Revision: 231048

URL: http://llvm.org/viewvc/llvm-project?rev=231048&view=rev
Log:
Fix a crasher where we might have a N_UNDF symbol with no name and this could cause ObjectFileMachO::ParseSymtab() to crash.

<rdar://problem/19989491>


Modified:
    lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp

Modified: lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp?rev=231048&r1=231047&r2=231048&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Mon Mar  2 19:40:46 2015
@@ -3200,6 +3200,7 @@ ObjectFileMachO::ParseSymtab ()
                                                         break;
                                                         
                                                     case N_UNDF:
+                                                        if (symbol_name && symbol_name[0])
                                                         {
                                                             ConstString undefined_name(symbol_name + ((symbol_name[0] == '_') ? 1 : 0));
                                                             undefined_name_to_desc[undefined_name] = nlist.n_desc;
@@ -4040,6 +4041,7 @@ ObjectFileMachO::ParseSymtab ()
                         break;
 
                     case N_UNDF:
+                        if (symbol_name && symbol_name[0])
                         {
                             ConstString undefined_name(symbol_name + ((symbol_name[0] == '_') ? 1 : 0));
                             undefined_name_to_desc[undefined_name] = nlist.n_desc;





More information about the lldb-commits mailing list