From f400116bcd139c44cb8622670a0403f1f3222580 Mon Sep 17 00:00:00 2001 From: CedricMocquillon Date: Sun, 13 Dec 2020 14:09:44 +0100 Subject: [PATCH] Use 32767 characters for log path --- components/crashcatcher/windows_crashcatcher.cpp | 2 +- components/crashcatcher/windows_crashshm.hpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/components/crashcatcher/windows_crashcatcher.cpp b/components/crashcatcher/windows_crashcatcher.cpp index 8495e84f8d..dc10f4dcb5 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_PATH) length = MAX_PATH; + if (length > MAX_LONG_PATH) length = MAX_LONG_PATH; strncpy(mShm->mStartup.mLogFilePath, crashLogPath.c_str(), length); mShm->mStartup.mLogFilePath[length] = '\0'; diff --git a/components/crashcatcher/windows_crashshm.hpp b/components/crashcatcher/windows_crashshm.hpp index 80e47f07b7..47929a45fe 100644 --- a/components/crashcatcher/windows_crashshm.hpp +++ b/components/crashcatcher/windows_crashshm.hpp @@ -9,6 +9,7 @@ namespace Crash { // Used to communicate between the app and the monitor, fields are is overwritten with each event. + static constexpr const int MAX_LONG_PATH = 0x7fff; struct CrashSHM { @@ -28,7 +29,7 @@ namespace Crash HANDLE mSignalApp; HANDLE mSignalMonitor; HANDLE mShmMutex; - char mLogFilePath[MAX_PATH + 1]; + char mLogFilePath[MAX_LONG_PATH]; } mStartup; struct Crashed