From da9f382d2c59ce76f5ced0f680bb200b316f8389 Mon Sep 17 00:00:00 2001 From: xperia64 Date: Fri, 12 Jan 2024 23:24:01 -0500 Subject: [PATCH] web_service: avoid undefined behavior assert of std::string::back (#7347) Co-authored-by: BuildTools --- src/web_service/web_backend.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/web_service/web_backend.cpp b/src/web_service/web_backend.cpp index a7831069b..c5a2108f2 100644 --- a/src/web_service/web_backend.cpp +++ b/src/web_service/web_backend.cpp @@ -30,7 +30,7 @@ struct Client::Impl { jwt = jwt_cache.jwt; } // normalize host expression - if (this->host.back() == '/') { + if (!this->host.empty() && this->host.back() == '/') { static_cast(this->host.pop_back()); } }