From 21e64984144a0851ec0e91745fe7054c65f6b10c Mon Sep 17 00:00:00 2001 From: sukibaby <163092272+sukibaby@users.noreply.github.com> Date: Tue, 6 May 2025 06:25:06 -0700 Subject: [PATCH] Resolve critical CWE-134 warning Resolves CWE-134: Use of Externally-Controlled Format String by using c_str on the path variable and removing an invalid string concatenation. --- src/archutils/Unix/CrashHandlerChild.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/archutils/Unix/CrashHandlerChild.cpp b/src/archutils/Unix/CrashHandlerChild.cpp index 5a695763e2..36bd5094e5 100644 --- a/src/archutils/Unix/CrashHandlerChild.cpp +++ b/src/archutils/Unix/CrashHandlerChild.cpp @@ -197,7 +197,7 @@ static void child_process() FILE *CrashDump = fopen( sCrashInfoPath, "w+" ); if(CrashDump == nullptr) { - fprintf( stderr, "Couldn't open " + sCrashInfoPath + ": %s\n", strerror(errno) ); + fprintf( stderr, "Couldn't open %s: %s\n", sCrashInfoPath.c_str(), strerror(errno) ); exit(1); }