Skip to content

Commit

Permalink
http2: fix underflow in http2 server push
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mauri870 committed Oct 15, 2023
1 parent d23d9bc commit 249fe55
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions http2/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 249fe55

Please sign in to comment.