aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/frontend
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2023-09-13 10:50:56 -0400
committerGitHub <[email protected]>2023-09-13 16:50:56 +0200
commit10587f2dd7dbda4184db2cd7994945ffc91db446 (patch)
treefe9ab43363ea3431f22e0821eba7298df07ec559 /src/zenserver/frontend
parentminor: log fix (diff)
downloadzen-10587f2dd7dbda4184db2cd7994945ffc91db446.tar.xz
zen-10587f2dd7dbda4184db2cd7994945ffc91db446.zip
fix url parsing crash (#399)
* Don't index out of string_view range when parsing URI in httpsys
Diffstat (limited to 'src/zenserver/frontend')
-rw-r--r--src/zenserver/frontend/frontend.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/zenserver/frontend/frontend.cpp b/src/zenserver/frontend/frontend.cpp
index b743ca939..8c8e5cb9c 100644
--- a/src/zenserver/frontend/frontend.cpp
+++ b/src/zenserver/frontend/frontend.cpp
@@ -89,7 +89,7 @@ HttpFrontendService::HandleRequest(zen::HttpServerRequest& Request)
using namespace std::literals;
std::string_view Uri = Request.RelativeUriWithExtension();
- for (; Uri[0] == '/'; Uri = Uri.substr(1))
+ for (; Uri.length() > 0 && Uri[0] == '/'; Uri = Uri.substr(1))
;
if (Uri.empty())
{