Skip to content

Commit

Permalink
Merge pull request from GHSA-3qx3-cg72-wrh9
Browse files Browse the repository at this point in the history
  • Loading branch information
sauwming authored Dec 22, 2021
1 parent cc339ac commit 8b621f1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pjmedia/src/pjmedia/rtcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -757,8 +757,15 @@ static void parse_rtcp_bye(pjmedia_rtcp_session *sess,

/* Check and get BYE reason */
if (size > 8) {
/* Make sure the BYE reason does not exceed:
* - the size of the available buffer
* - the declared reason's length
* - the actual packet size
*/
reason.slen = PJ_MIN(sizeof(sess->stat.peer_sdes_buf_),
*((pj_uint8_t*)pkt+8));
reason.slen = PJ_MIN(reason.slen, size-9);

pj_memcpy(sess->stat.peer_sdes_buf_, ((pj_uint8_t*)pkt+9),
reason.slen);
reason.ptr = sess->stat.peer_sdes_buf_;
Expand Down

0 comments on commit 8b621f1

Please sign in to comment.