From 94a8a03c68da64307d4ccd9a4b0b1f8b7b46ef49 Mon Sep 17 00:00:00 2001 From: freyers Date: Fri, 15 May 2026 21:34:34 +0000 Subject: [PATCH] fix(callstack): guard against NULL from strchr in symbol parsing backtrace_symbols lines without a '+' (stripped/static frames) make strchr return NULL; the code then dereferenced it via if(*plus), crashing while dumping callstacks on the POSIX/macOS path. Check the pointer before dereferencing. --- CCPCallstack.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CCPCallstack.cpp b/CCPCallstack.cpp index c5c1f1f..908a946 100644 --- a/CCPCallstack.cpp +++ b/CCPCallstack.cpp @@ -394,7 +394,7 @@ void CCPCallstack::Enumerate( void ( *callback )( size_t codePointer, const char { std::string record = lines[i]; const char* plus = strchr( lines[i], '+' ); - if( *plus ) + if( plus && *plus ) { std::string name; GetLastWord( lines[i], plus - 1, name );