http2: fix underflow in http2 server push

After CL 534215 was merged to fix a CVE it introduced
an underflow when we try to decrement sc.curHandlers
in handlerDone.

There is one place that calls runHandler without
incrementing curHandlers. Seems to only affect http.Pusher.

For golang/go#63511
This commit is contained in:
Mauri de Souza Meneguzzo
2023-10-15 20:49:02 -03:00
parent d23d9bc549
commit 249fe55f75

View File

@@ -3187,6 +3187,7 @@ func (sc *serverConn) startPush(msg *startPushRequest) {
panic(fmt.Sprintf("newWriterAndRequestNoBody(%+v): %v", msg.url, err))
}
sc.curHandlers++
go sc.runHandler(rw, req, sc.handler.ServeHTTP)
return promisedID, nil
}