diff options
author | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-03-18 14:58:39 +0000 |
---|---|---|
committer | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-03-18 14:58:39 +0000 |
commit | 2fbae294015891121b3fef02e73f8356f8629347 (patch) | |
tree | 64ed08f86dbc0127be2f3f03354257387b3512ad /main/rtp.c | |
parent | 57afe0f38f939eb78f0a7919fc1b810a1051a9c7 (diff) |
Put a maximum limit on the number of payloads accepted, and also make sure a given payload does not exceed our maximum value.
(AST-2008-002)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@109386 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/rtp.c')
-rw-r--r-- | main/rtp.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/main/rtp.c b/main/rtp.c index 3d3766e9c..fc6f9a467 100644 --- a/main/rtp.c +++ b/main/rtp.c @@ -1652,6 +1652,9 @@ void ast_rtp_set_m_type(struct ast_rtp* rtp, int pt) an unknown media type */ void ast_rtp_unset_m_type(struct ast_rtp* rtp, int pt) { + if (pt < 0 || pt > MAX_RTP_PT) + return; /* bogus payload type */ + ast_mutex_lock(&rtp->bridge_lock); rtp->current_RTP_PT[pt].isAstFormat = 0; rtp->current_RTP_PT[pt].code = 0; |