diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-08-31 05:09:20 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-08-31 05:09:20 +0000 |
commit | 116b73cebbd211cbbeaaba949acc84178cf24784 (patch) | |
tree | 2edb606c49a3885a9da9338c37f8902bcc2c8f86 /rtp.c | |
parent | 3f5d756338caeffa1b0bdb98a79ad5feb914cfe1 (diff) |
Be sure we still check for proper buffer length
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3685 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'rtp.c')
-rwxr-xr-x | rtp.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -452,6 +452,11 @@ struct ast_frame *ast_rtp_read(struct ast_rtp *rtp) hdrlen += (rtpheader[3] & 0xffff) << 2; } + if (res < hdrlen) { + ast_log(LOG_WARNING, "RTP Read too short (%d, expecting %d)\n", res, hdrlen); + return &null_frame; + } + #if 0 printf("Got RTP packet from %s:%d (type %d, seq %d, ts %d, len = %d)\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), ntohs(sin.sin_port), payloadtype, seqno, timestamp,res - hdrlen); #endif |