From e88e60f475e3c0b1c90df559b5c2aef3e1cd356a Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Tue, 26 Aug 2025 18:08:38 +0200 Subject: [PATCH] Check length before dereferencing --- components/lua/configuration.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/lua/configuration.cpp b/components/lua/configuration.cpp index 3ca350e39b..cbec2e4abc 100644 --- a/components/lua/configuration.cpp +++ b/components/lua/configuration.cpp @@ -196,7 +196,7 @@ namespace LuaUtil throw std::runtime_error(std::format("No flags found in: {}", line)); std::string_view tagsStr = line.substr(0, semicolonPos); std::string_view scriptPath = line.substr(semicolonPos + 1); - while (isSpace(scriptPath[0])) + while (!scriptPath.empty() && isSpace(scriptPath[0])) scriptPath = scriptPath.substr(1); ESM::LuaScriptCfg& script = cfg.mScripts.emplace_back();