[Lldb-commits] [lldb] r288026 - Fix a crash in ProcessPOSIXLog
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Mon Nov 28 03:47:14 PST 2016
Author: labath
Date: Mon Nov 28 05:47:14 2016
New Revision: 288026
URL: http://llvm.org/viewvc/llvm-project?rev=288026&view=rev
Log:
Fix a crash in ProcessPOSIXLog
We are getting a null pointer for the list of categories here (presumably due to
the args refactor).
Modified:
lldb/trunk/source/Plugins/Process/POSIX/ProcessPOSIXLog.cpp
Modified: lldb/trunk/source/Plugins/Process/POSIX/ProcessPOSIXLog.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/POSIX/ProcessPOSIXLog.cpp?rev=288026&r1=288025&r2=288026&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/POSIX/ProcessPOSIXLog.cpp (original)
+++ lldb/trunk/source/Plugins/Process/POSIX/ProcessPOSIXLog.cpp Mon Nov 28 05:47:14 2016
@@ -95,7 +95,7 @@ void ProcessPOSIXLog::DisableLog(const c
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
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);
More information about the lldb-commits
mailing list