From 813969a46e6ed8962acf2da49994762cf6004d57 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Sun, 2 May 2021 11:21:54 +0000 Subject: [PATCH] Fix an off-by-one in windows_crashcatcher.cpp --- components/crashcatcher/windows_crashcatcher.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/crashcatcher/windows_crashcatcher.cpp b/components/crashcatcher/windows_crashcatcher.cpp index 33ec319aa2..185eee6aa6 100644 --- a/components/crashcatcher/windows_crashcatcher.cpp +++ b/components/crashcatcher/windows_crashcatcher.cpp @@ -136,7 +136,7 @@ namespace Crash memset(mShm->mStartup.mLogFilePath, 0, sizeof(mShm->mStartup.mLogFilePath)); int length = crashLogPath.length(); - if (length > MAX_LONG_PATH) length = MAX_LONG_PATH; + if (length >= MAX_LONG_PATH) length = MAX_LONG_PATH - 1; strncpy(mShm->mStartup.mLogFilePath, crashLogPath.c_str(), length); mShm->mStartup.mLogFilePath[length] = '\0';