From e70cd59a5f3ca70c2cc75453a0921ce0e954785c Mon Sep 17 00:00:00 2001 From: WinterSolstice8 <60417494+wintersolstice8@users.noreply.github.com> Date: Thu, 12 Dec 2024 22:04:55 -0700 Subject: [PATCH] [core] Adjust db::escapeString to emulate strlen This makes it more in line with the old SqlConnection::EscapeString --- src/common/database.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/common/database.cpp b/src/common/database.cpp index 0f26cad120b..bcbba8bbcd8 100644 --- a/src/common/database.cpp +++ b/src/common/database.cpp @@ -195,6 +195,10 @@ auto db::escapeString(std::string const& str) -> std::string { char c = str[i]; + // Emulate SqlConnection::EscapeString using strlen + if (c == '\0') + break; + auto it = replacements.find(c); if (it != replacements.end()) {