Skip to content

Commit 76ad9c1

Browse files
committed
IsSctp(): check length is padded to 4 bytes
1 parent a6e3f2a commit 76ad9c1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

worker/src/RTC/SCTP/Packet.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include "RTC/SCTP/Packet.hpp"
55
#include "Logger.hpp"
6+
#include "Utils.hpp"
67

78
namespace RTC
89
{
@@ -19,7 +20,9 @@ namespace RTC
1920
return (
2021
(len >= Packet::CommonHeaderSize) &&
2122
// Source and destination ports cannot be 0.
22-
(header->sourcePort != 0 && header->destinationPort != 0)
23+
(header->sourcePort != 0 && header->destinationPort != 0) &&
24+
// Size must be multiple of 4 bytes.
25+
Utils::Byte::IsPaddedTo4Bytes(len)
2326
);
2427
}
2528

0 commit comments

Comments
 (0)