From f6c109e3fcdba313a10db3b88dcd7926712dba70 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sat, 13 Aug 2022 16:27:44 +0200 Subject: [PATCH] (Windows) Trigger emergency shutdown on wide string conversion errors to preserve data integrity at all times. --- es-core/src/utils/StringUtil.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/es-core/src/utils/StringUtil.cpp b/es-core/src/utils/StringUtil.cpp index b9308249c..0fabe865e 100644 --- a/es-core/src/utils/StringUtil.cpp +++ b/es-core/src/utils/StringUtil.cpp @@ -13,6 +13,7 @@ #include "utils/StringUtil.h" #include "Log.h" +#include "utils/PlatformUtil.h" #include #include @@ -624,6 +625,8 @@ namespace Utils catch (...) { LOG(LogError) << "StringUtil::stringToWideString(): Conversion failed, invalid " "characters in source string?"; + LOG(LogError) << stringArg; + Utils::Platform::emergencyShutdown(); return L""; } } @@ -637,6 +640,7 @@ namespace Utils catch (...) { LOG(LogError) << "StringUtil::wideStringToString(): Conversion failed, invalid " "characters in source string?"; + Utils::Platform::emergencyShutdown(); return ""; } }