diff options
author | Runxi Yu <me@runxiyu.org> | 2025-02-12 16:14:16 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-02-12 16:14:16 +0800 |
commit | 3c3bf5038bee6fce149aae0d977bb4d4e1e2073c (patch) | |
tree | b1acd28ca9524770f34e6406eeb8a9e1f48f3549 | |
parent | *.go: Reformat (diff) | |
download | forge-3c3bf5038bee6fce149aae0d977bb4d4e1e2073c.tar.gz forge-3c3bf5038bee6fce149aae0d977bb4d4e1e2073c.tar.zst forge-3c3bf5038bee6fce149aae0d977bb4d4e1e2073c.zip |
router.go: Fix out-of-bounds read on /:
-rw-r--r-- | router.go | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -16,6 +16,11 @@ func (router *http_router_t) ServeHTTP(w http.ResponseWriter, r *http.Request) { return } + if len(segments) < 2 { + http.Error(w, "Blank system endpoint", http.StatusNotFound) + return + } + if segments[0] == ":" { switch segments[1] { case "static": |