From 1766a3dbce71eb1bc6dbe3b01994d95f916e96d1 Mon Sep 17 00:00:00 2001 From: Bjorn Terelius Date: Tue, 16 Jul 2024 09:21:15 +0200 Subject: [PATCH] Treat negative SCTP message size limit as maximal (only bounded by buffer size) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: webrtc:350362794 Change-Id: Ie80e89a1359fbe7229452e59715b66e951a2592b Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/357240 Reviewed-by: Florent Castelli Commit-Queue: Björn Terelius Cr-Commit-Position: refs/heads/main@{#42641} --- pc/media_session.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pc/media_session.cc b/pc/media_session.cc index e3aa0320ea..9cd1e9b46a 100644 --- a/pc/media_session.cc +++ b/pc/media_session.cc @@ -2328,7 +2328,7 @@ RTCError MediaSessionDescriptionFactory::AddDataContentForAnswer( // 0 is treated specially - it means "I can accept any size". Since // we do not implement infinite size messages, reply with // 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); } else { data_answer->as_sctp()->set_max_message_size(std::min(