From e93dfc22b190705b7c45711c79809776eb9f4355 Mon Sep 17 00:00:00 2001 From: a Date: Tue, 26 Nov 2024 23:15:04 +0200 Subject: [PATCH] check tag string size before access --- dll/steam_ugc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dll/steam_ugc.cpp b/dll/steam_ugc.cpp index 0f45df63..66ce3274 100644 --- a/dll/steam_ugc.cpp +++ b/dll/steam_ugc.cpp @@ -381,7 +381,7 @@ std::optional Steam_UGC::get_query_ugc_tag(UGCQueryHandle_t handle, if (indexTag >= res.size()) return std::nullopt; std::string tmp = res[indexTag]; - if (tmp.back() == ',') { + if (!tmp.empty() && tmp.back() == ',') { tmp = tmp.substr(0, tmp.size() - 1); } return tmp;