From 60b81dff85029de1db5fbb50f6b2000632e03b73 Mon Sep 17 00:00:00 2001 From: Enrico Granata Date: Sat, 29 Sep 2012 00:45:53 +0000 Subject: [PATCH] Fixing a potential crasher in the data formatters where we fail to check for NULL or empty class name llvm-svn: 164870 --- lldb/source/Core/CXXFormatterFunctions.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lldb/source/Core/CXXFormatterFunctions.cpp b/lldb/source/Core/CXXFormatterFunctions.cpp index c98c8cba6781..7cf9e37f7606 100644 --- a/lldb/source/Core/CXXFormatterFunctions.cpp +++ b/lldb/source/Core/CXXFormatterFunctions.cpp @@ -487,6 +487,9 @@ lldb_private::formatters::NSStringSummaryProvider (ValueObject& valobj, Stream& const char* class_name = descriptor->GetClassName().GetCString(); + if (!class_name || !*class_name) + return false; + uint64_t info_bits_location = valobj_addr + ptr_size; if (process_sp->GetByteOrder() != lldb::eByteOrderLittle) info_bits_location += 3;