@cryptotaxi247 / kubo / commits / a329e4fc6

p2p-proxy: better request length checking

Adin Schmahmann committed Dec 1, 2020 at 11:01 UTC a329e4fc6674909336c56fae2258c6f906af0dbf
1 file changed +1 -1
core/corehttp/p2p_proxy.go
+1 -1
@@ -65,7 +65,7 @@ func parseRequest(request *http.Request) (*proxyRequest, error) {
65 }
66
67 split = strings.SplitN(path, "/", 7)
68 - if split[3] != "x" || split[5] != "http" {
68 + if len(split) < 7 || split[3] != "x" || split[5] != "http" {
69 return nil, fmt.Errorf("Invalid request path '%s'", path)
70 }
71