http3: Correctly reject extra bytes after GOAWAY
@@ -80,12 +80,13 @@ int h2o_http3_decode_goaway_frame(h2o_http3_goaway_frame_t *frame, const uint8_t
{
const uint8_t *src = payload, *end = src + len;
- /* quicly_decodev below will reject len == 0 case */
- if (len > PTLS_ENCODE_QUICINT_CAPACITY)
+ if ((frame->stream_or_push_id = quicly_decodev(&src, end)) == UINT64_MAX)
goto Fail;
- if ((frame->stream_or_push_id = quicly_decodev(&src, end)) == UINT64_MAX)
+ if (src != end) {
+ /* there was an extra byte(s) after a valid QUIC variable-length integer */
goto Fail;
+ }
return 0;
