From cff9816f1e0516caefc48da25fea8bcfaec881ba Mon Sep 17 00:00:00 2001 From: freyers Date: Fri, 15 May 2026 22:32:06 +0000 Subject: [PATCH] fix(crashpad): capture a real CONTEXT for the immediate dump LPCONTEXT was zero-initialised to null, passed to GetThreadContext and then dereferenced, guaranteeing a crash in the crash path. Capture the calling thread's context with RtlCaptureContext and pass it to DumpWithoutCrash. --- Crashpad.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Crashpad.cpp b/Crashpad.cpp index ad7f6ab..a85d8cb 100644 --- a/Crashpad.cpp +++ b/Crashpad.cpp @@ -154,11 +154,10 @@ void CrashpadCrashInterface::ProduceImmediateDump() if( m_client ) { #if _WIN32 - LPCONTEXT lpContext{}; - if( GetThreadContext( GetCurrentThread(), lpContext ) ) - { - m_client->DumpWithoutCrash( *lpContext ); - } + CONTEXT context{}; + context.ContextFlags = CONTEXT_ALL; + RtlCaptureContext( &context ); + m_client->DumpWithoutCrash( context ); #endif } }