avoid recursion when skipping unknown HTTP/3 frames (#3354)

This commit is contained in:
Marten Seemann 2022-03-22 16:48:17 +01:00 committed by GitHub
parent 2661c2807d
commit 4725ddebf3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,6 +14,7 @@ type frame interface{}
func parseNextFrame(r io.Reader) (frame, error) {
qr := quicvarint.NewReader(r)
for {
t, err := quicvarint.Read(qr)
if err != nil {
return nil, err
@ -45,7 +46,7 @@ func parseNextFrame(r io.Reader) (frame, error) {
if _, err := io.CopyN(ioutil.Discard, qr, int64(l)); err != nil {
return nil, err
}
return parseNextFrame(qr)
}
}
}