summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2008-03-18 15:08:09 +0000
committerJoshua Colp <jcolp@digium.com>2008-03-18 15:08:09 +0000
commit10cdbe28a8fea32144beee2c530471ffd457c997 (patch)
tree1bef96c3c1de596e64f97c1fe68e4b8646063081 /main
parent263c658a6b215ab1e0bf059523d7426eda23c111 (diff)
Merged revisions 109386 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r109386 | file | 2008-03-18 11:58:39 -0300 (Tue, 18 Mar 2008) | 3 lines 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: https://origsvn.digium.com/svn/asterisk/trunk@109390 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main')
-rw-r--r--main/rtp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/main/rtp.c b/main/rtp.c
index 1199ffb35..4fcf747da 100644
--- a/main/rtp.c
+++ b/main/rtp.c
@@ -1976,6 +1976,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 */
+
rtp_bridge_lock(rtp);
rtp->current_RTP_PT[pt].isAstFormat = 0;
rtp->current_RTP_PT[pt].code = 0;