summaryrefslogtreecommitdiff
path: root/rtp.c
diff options
context:
space:
mode:
authorMark Spencer <markster@digium.com>2004-08-31 05:09:20 +0000
committerMark Spencer <markster@digium.com>2004-08-31 05:09:20 +0000
commit6749f1b8b5ad2a9ba4bde209f401e4c747d5ea53 (patch)
tree2edb606c49a3885a9da9338c37f8902bcc2c8f86 /rtp.c
parent8ff9c0d1b93e520b934deb6b44d4daddf679b99c (diff)
Be sure we still check for proper buffer length
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3685 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'rtp.c')
-rwxr-xr-xrtp.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/rtp.c b/rtp.c
index 02b30bc6f..44680683e 100755
--- a/rtp.c
+++ b/rtp.c
@@ -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