Treat negative SCTP message size limit as maximal (only bounded by buffer size)

Bug: webrtc:350362794
Change-Id: Ie80e89a1359fbe7229452e59715b66e951a2592b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/357240
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42641}
This commit is contained in:
Bjorn Terelius 2024-07-16 09:21:15 +02:00 committed by WebRTC LUCI CQ
parent 1869616223
commit 1766a3dbce

View File

@ -2328,7 +2328,7 @@ RTCError MediaSessionDescriptionFactory::AddDataContentForAnswer(
// 0 is treated specially - it means "I can accept any size". Since // 0 is treated specially - it means "I can accept any size". Since
// we do not implement infinite size messages, reply with // we do not implement infinite size messages, reply with
// kSctpSendBufferSize. // kSctpSendBufferSize.
if (offer_data_description->max_message_size() == 0) { if (offer_data_description->max_message_size() <= 0) {
data_answer->as_sctp()->set_max_message_size(kSctpSendBufferSize); data_answer->as_sctp()->set_max_message_size(kSctpSendBufferSize);
} else { } else {
data_answer->as_sctp()->set_max_message_size(std::min( data_answer->as_sctp()->set_max_message_size(std::min(