Skip to content

Commit

Permalink
srtp/srtcp: add sanity check for rtcp->tag_len
Browse files Browse the repository at this point in the history
  • Loading branch information
sreimers committed Mar 16, 2022
1 parent 3e7a32a commit 198fbd9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/srtp/srtcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ int srtcp_decrypt(struct srtp *srtp, struct mbuf *mb)
uint8_t tag_pkt[SHA_DIGEST_LENGTH] = {0};
const size_t tag_start = mb->pos;

if (rtcp->tag_len > SHA_DIGEST_LENGTH)
return ERANGE;

err = mbuf_read_mem(mb, tag_pkt, rtcp->tag_len);
if (err)
return err;
Expand Down

0 comments on commit 198fbd9

Please sign in to comment.