From 3c3bf5038bee6fce149aae0d977bb4d4e1e2073c Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Wed, 12 Feb 2025 16:14:16 +0800 Subject: [PATCH] router.go: Fix out-of-bounds read on /: --- router.go | 5 +++++ diff --git a/router.go b/router.go index 5a771315ff57a234348e04e4a5cff210ad827d64..c8436985fa2738b051215122ad58f619b0f82be3 100644 --- a/router.go +++ b/router.go @@ -16,6 +16,11 @@ http.Error(w, err.Error(), http.StatusBadRequest) return } + if len(segments) < 2 { + http.Error(w, "Blank system endpoint", http.StatusNotFound) + return + } + if segments[0] == ":" { switch segments[1] { case "static": -- 2.48.1