Skip to content

Commit

Permalink
Fix breaking change of overwriting sctp packet
Browse files Browse the repository at this point in the history
  • Loading branch information
disa6302 committed Oct 9, 2023
1 parent 5955708 commit edcd6e3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/source/Sctp/Sctp.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ STATUS createSctpSession(PSctpSessionCallbacks pSctpSessionCallbacks, PSctpSessi

CHK(ppSctpSession != NULL && pSctpSessionCallbacks != NULL, STATUS_NULL_ARG);

pSctpSession = (PSctpSession) MEMALLOC(SIZEOF(SctpSession));
pSctpSession = (PSctpSession) MEMCALLOC(1, SIZEOF(SctpSession));
CHK(pSctpSession != NULL, STATUS_NOT_ENOUGH_MEMORY);

MEMSET(&params, 0x00, SIZEOF(struct sctp_paddrparams));
Expand Down Expand Up @@ -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);
MEMCPY(pSctpSession->packet, data, length);

pSctpSession->sctpSessionCallbacks.dataChannelOpenFunc(pSctpSession->sctpSessionCallbacks.customData, streamId, data + SCTP_DCEP_HEADER_LENGTH,
labelLength);
Expand Down

0 comments on commit edcd6e3

Please sign in to comment.