A peer may emit a MAX_STREAMS frame to increase the window of opened
streams. Such frame is parsed via qcc_recv_max_streams() since 3.3 as it
is mandatory for backend support.
This patch fixes the maximum value authorized in MAX_STREAMS. As
specified by RFC 9000, it cannot exceed 2^60, the maximum number of
streams of a given type, as stream IDs are encoded on 62 bits with the 2
least significant bits reserved for the type.
This must be backported up to 3.3.
* permits opening of a stream larger than this limit MUST be treated
* as a connection error of type FRAME_ENCODING_ERROR.
*/
- if (max > QUIC_VARINT_8_BYTE_MAX) {
+ if (max > ((uint64_t)1 << 60)) {
TRACE_ERROR("invalid MAX_STREAMS value", QMUX_EV_QCC_RECV, qcc->conn);
qcc_set_error(qcc, QC_ERR_FRAME_ENCODING_ERROR, 0,
muxc_tevt_type_proto_err);