mirror of
https://github.com/facebookincubator/mvfst.git
synced 2025-11-25 15:43:13 +03:00
Check for max streams id limits when decoding MAX_STREAMS frame
Summary: Checks that MaxStreamsId is in range during MaxStreamsFrame decode, otherwise throws exception. Added tests for MaxStreamsFrame decode. Reviewed By: mjoras Differential Revision: D27520634 fbshipit-source-id: f903763781639d078f92080b98f15b97e04a8d60
This commit is contained in:
committed by
Facebook GitHub Bot
parent
cfbf59202d
commit
aac8f1ac91
@@ -449,7 +449,7 @@ MaxStreamDataFrame decodeMaxStreamDataFrame(folly::io::Cursor& cursor) {
|
||||
|
||||
MaxStreamsFrame decodeBiDiMaxStreamsFrame(folly::io::Cursor& cursor) {
|
||||
auto streamCount = decodeQuicInteger(cursor);
|
||||
if (!streamCount) {
|
||||
if (!streamCount || streamCount->first > kMaxMaxStreams) {
|
||||
throw QuicTransportException(
|
||||
"Invalid Bi-directional streamId",
|
||||
quic::TransportErrorCode::FRAME_ENCODING_ERROR,
|
||||
@@ -460,7 +460,7 @@ MaxStreamsFrame decodeBiDiMaxStreamsFrame(folly::io::Cursor& cursor) {
|
||||
|
||||
MaxStreamsFrame decodeUniMaxStreamsFrame(folly::io::Cursor& cursor) {
|
||||
auto streamCount = decodeQuicInteger(cursor);
|
||||
if (!streamCount) {
|
||||
if (!streamCount || streamCount->first > kMaxMaxStreams) {
|
||||
throw QuicTransportException(
|
||||
"Invalid Uni-directional streamId",
|
||||
quic::TransportErrorCode::FRAME_ENCODING_ERROR,
|
||||
|
||||
Reference in New Issue
Block a user