mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 14:16:44 +00:00
swarm/api/http: server handler: check protocol substring length to fix slice out of bounds crash
This commit is contained in:
parent
2b1c950193
commit
38184bf18d
1 changed files with 4 additions and 2 deletions
|
|
@ -86,8 +86,10 @@ func handler(w http.ResponseWriter, r *http.Request, a *api.Api) {
|
|||
return
|
||||
}
|
||||
}
|
||||
if len(proto) > 4 {
|
||||
raw = proto[1:5] == "bzzr"
|
||||
nameresolver = proto[1:5] != "bzzi"
|
||||
}
|
||||
|
||||
glog.V(logger.Debug).Infof(
|
||||
"[BZZ] Swarm: %s request over protocol %s '%s' received.",
|
||||
|
|
|
|||
Loading…
Reference in a new issue