Skip to content

Commit f04e0e0

Browse files
authored
bounds-check OnUserControlMessage like sibling control handlers (#3329)
* bounds-check OnUserControlMessage like sibling control handlers * Use unsigned literals for user control message length bounds
1 parent 9188d92 commit f04e0e0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/brpc/policy/rtmp_protocol.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1925,8 +1925,8 @@ bool RtmpChunkStream::OnSetPeerBandwidth(
19251925

19261926
bool RtmpChunkStream::OnUserControlMessage(
19271927
const RtmpMessageHeader& mh, butil::IOBuf* msg_body, Socket* socket) {
1928-
if (mh.message_length > 32) {
1929-
RTMP_ERROR(socket, mh) << "No user control message long as "
1928+
if (mh.message_length < 2u || mh.message_length > 32u) {
1929+
RTMP_ERROR(socket, mh) << "Invalid user control message length="
19301930
<< mh.message_length << " bytes";
19311931
return false;
19321932
}

0 commit comments

Comments
 (0)