From 23a608a5049205d9011c7b672eea3f40c0af624b Mon Sep 17 00:00:00 2001 From: Ovahlord Date: Mon, 4 Aug 2025 20:13:21 +0200 Subject: [PATCH] Core/Logging: fixed log level range check in Log::SetLogLevel --- src/common/Logging/Log.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/common/Logging/Log.cpp b/src/common/Logging/Log.cpp index a59da3f53e..ca4b9581bf 100644 --- a/src/common/Logging/Log.cpp +++ b/src/common/Logging/Log.cpp @@ -262,10 +262,12 @@ std::string Log::GetTimestampStr() bool Log::SetLogLevel(std::string const& name, char const* newLevelc, bool isLogger /* = true */) { - LogLevel newLevel = LogLevel(atoi(newLevelc)); - if (static_cast(newLevel) < 0) + int32 newLeveli = atoi(newLevelc); + if (newLeveli < 0) return false; + LogLevel newLevel = static_cast(newLeveli); + if (isLogger) { auto it = loggers.begin();