From 5e3bc389c3fc0068eb2d1840f45fb21bdeb11a54 Mon Sep 17 00:00:00 2001 From: sukibaby <163092272+sukibaby@users.noreply.github.com> Date: Sun, 23 Jun 2024 05:16:05 -0700 Subject: [PATCH] Fix uninitialized variable in Crash.cpp --- src/archutils/Win32/Crash.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/archutils/Win32/Crash.cpp b/src/archutils/Win32/Crash.cpp index a3457ab1f8..16a632530b 100644 --- a/src/archutils/Win32/Crash.cpp +++ b/src/archutils/Win32/Crash.cpp @@ -187,8 +187,11 @@ static const char *CrashGetModuleBaseName(HMODULE hmod, char *pszBaseName) void RunChild() { - HANDLE hProcess, hToStdin, hFromStdout; - StartChild( hProcess, hToStdin, hFromStdout ); + HANDLE hProcess = nullptr, hToStdin = nullptr, hFromStdout = nullptr; + if (!StartChild(hProcess, hToStdin, hFromStdout)) + { + ASSERT_M(0, "Failed to start child process"); + } // 0. Send a handle of this process to the crash handling process, which it // can use to handle symbol lookups. @@ -200,7 +203,7 @@ void RunChild() hProcess, &hTargetHandle, 0, - false, + FALSE, DUPLICATE_SAME_ACCESS ); @@ -676,4 +679,3 @@ void CrashHandler::ForceCrash( const char *reason ) * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -