aboutsummaryrefslogtreecommitdiffstats
path: root/res/res_rtp_asterisk.c
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2009-07-27 20:54:54 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2009-07-27 20:54:54 +0000
commite8cb2dc645e59d75384994e2a570767e556d52a2 (patch)
treec6a855f5196745f34399905cdb9f9bbe5fda7f8a /res/res_rtp_asterisk.c
parentd85d8869235e74d3988f33db2995257c4ea26b3c (diff)
Gracefully handle malformed RTP text packets.
AST-2009-004 git-svn-id: http://svn.digium.com/svn/asterisk/trunk@209235 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_rtp_asterisk.c')
-rw-r--r--res/res_rtp_asterisk.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c
index edf1d7272..d281fa515 100644
--- a/res/res_rtp_asterisk.c
+++ b/res/res_rtp_asterisk.c
@@ -2078,6 +2078,9 @@ static struct ast_frame *ast_rtp_read(struct ast_rtp_instance *instance, int rtc
rtp->f.subclass = AST_FORMAT_T140;
header_end = memchr(data, ((*data) & 0x7f), rtp->f.datalen);
+ if (header_end == NULL) {
+ return &ast_null_frame;
+ }
header_end++;
header_length = header_end - data;