From 4fd575423483378560db55ee291576d77b57c7a0 Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Mon, 28 Nov 2016 11:47:14 +0000 Subject: Fix a crash in ProcessPOSIXLog We are getting a null pointer for the list of categories here (presumably due to the args refactor). llvm-svn: 288026 --- lldb/source/Plugins/Process/POSIX/ProcessPOSIXLog.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lldb/source/Plugins/Process/POSIX/ProcessPOSIXLog.cpp b/lldb/source/Plugins/Process/POSIX/ProcessPOSIXLog.cpp index 7f07bd568a2..9ced11c7ca2 100644 --- a/lldb/source/Plugins/Process/POSIX/ProcessPOSIXLog.cpp +++ b/lldb/source/Plugins/Process/POSIX/ProcessPOSIXLog.cpp @@ -95,7 +95,7 @@ void ProcessPOSIXLog::DisableLog(const char **args, Stream *feedback_strm) { uint32_t flag_bits = 0; flag_bits = log->GetMask().Get(); - for (; args[0]; args++) { + for (; args && args[0]; args++) { const char *arg = args[0]; uint32_t bits = GetFlagBits(arg); @@ -134,7 +134,7 @@ Log *ProcessPOSIXLog::EnableLog(StreamSP &log_stream_sp, uint32_t log_options, if (g_log) { bool got_unknown_category = false; - for (; args[0]; args++) { + for (; args && args[0]; args++) { const char *arg = args[0]; uint32_t bits = GetFlagBits(arg); -- cgit v1.2.3