Fix integer overflow when computing outgoing_max_streams_
gfe-relnote: fix integer overflow in code gated by QUIC_VERSION_99
PiperOrigin-RevId: 249221642
Change-Id: Ia354d99b218d81bcf6b390c90e4d6aad533dd7fe
diff --git a/quic/core/quic_stream_id_manager.cc b/quic/core/quic_stream_id_manager.cc
index 7fac723..2921268 100644
--- a/quic/core/quic_stream_id_manager.cc
+++ b/quic/core/quic_stream_id_manager.cc
@@ -127,8 +127,8 @@
// This implementation only supports 32 bit Stream IDs, so limit max streams
// if it would exceed the max 32 bits can express.
- outgoing_max_streams_ = std::min(
- static_cast<QuicStreamCount>(max_open_streams),
+ outgoing_max_streams_ = std::min<size_t>(
+ max_open_streams,
QuicUtils::GetMaxStreamCount(unidirectional_, session_->perspective()));
return true;
}