From c1415397fccb336e7e6143c32f016088fffc5970 Mon Sep 17 00:00:00 2001 From: ela34 <8700736+ela34@users.noreply.github.com> Date: Wed, 1 Sep 2021 17:41:25 +0200 Subject: [PATCH] [FIX] When protocol in DCEP header of data channel open command is not empty, there is a check preventing the data channel to be opened. Now protocol length is correctly handled to avoid check failing. (#1228) --- src/source/Sctp/Sctp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/source/Sctp/Sctp.c b/src/source/Sctp/Sctp.c index 2af922e0cd..1d0b8194b0 100644 --- a/src/source/Sctp/Sctp.c +++ b/src/source/Sctp/Sctp.c @@ -309,7 +309,7 @@ STATUS handleDcepPacket(PSctpSession pSctpSession, UINT32 streamId, PBYTE data, // Assert that is DCEP of type DataChannelOpen CHK(length > SCTP_DCEP_HEADER_LENGTH && data[0] == DCEP_DATA_CHANNEL_OPEN, STATUS_SUCCESS); - + MEMCPY(&labelLength, data + 8, SIZEOF(UINT16)); MEMCPY(&protocolLength, data + 10, SIZEOF(UINT16)); putInt16((PINT16) &labelLength, labelLength); @@ -318,7 +318,6 @@ STATUS handleDcepPacket(PSctpSession pSctpSession, UINT32 streamId, PBYTE data, CHK((labelLength + protocolLength + SCTP_DCEP_HEADER_LENGTH) >= length, STATUS_SCTP_INVALID_DCEP_PACKET); CHK(SCTP_MAX_ALLOWABLE_PACKET_LENGTH >= length, STATUS_SCTP_INVALID_DCEP_PACKET); - pSctpSession->sctpSessionCallbacks.dataChannelOpenFunc(pSctpSession->sctpSessionCallbacks.customData, streamId, data + SCTP_DCEP_HEADER_LENGTH, labelLength);