[asterisk-commits] oej: branch oej/pinefrog-rtcp-1.8 r386832 - /team/oej/pinefrog-rtcp-1.8/res/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Apr 29 06:22:24 CDT 2013
Author: oej
Date: Mon Apr 29 06:22:20 2013
New Revision: 386832
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=386832
Log:
Make sure we don't crash when communicating with some other servers
Modified:
team/oej/pinefrog-rtcp-1.8/res/res_rtp_asterisk.c
Modified: team/oej/pinefrog-rtcp-1.8/res/res_rtp_asterisk.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/pinefrog-rtcp-1.8/res/res_rtp_asterisk.c?view=diff&rev=386832&r1=386831&r2=386832
==============================================================================
--- team/oej/pinefrog-rtcp-1.8/res/res_rtp_asterisk.c (original)
+++ team/oej/pinefrog-rtcp-1.8/res/res_rtp_asterisk.c Mon Apr 29 06:22:20 2013
@@ -404,7 +404,7 @@
{ RTCP_PT_TOKEN,"Port mapping, RFC 6284", },
};
-const char *find_rtcp_pt(int payload)
+static const char *find_rtcp_pt(int payload)
{
int x;
@@ -2235,9 +2235,9 @@
ast_verbose(" Received an SDES from %s - Total length %d (%d bytes)\n", ast_sockaddr_stringify(&rtp->rtcp->them), length-i, ((length-i)*4) - 6);
}
while (j < length * 4) {
- sdestype = (int) *sdes;
+ sdestype = (uint8_t) *sdes;
sdes++;
- sdeslength = (int) *sdes;
+ sdeslength = (uint8_t) *sdes;
sdes++;
if (rtcp_debug_test_addr(&addr)) {
ast_verbose(" --- SDES Type %u, Length %u Curj %d)\n", sdestype, sdeslength, j);
@@ -2245,6 +2245,9 @@
switch (sdestype) {
case SDES_CNAME:
if (!ast_strlen_zero(rtp->rtcp->theircname)) {
+ if (sdeslength > sizeof(rtp->rtcp->theircname)) {
+ sdeslength = sizeof(rtp->rtcp->theircname) - 1;
+ }
if (strncmp(rtp->rtcp->theircname, sdes, sdeslength)) {
ast_log(LOG_WARNING, "New RTP stream received (new RTCP CNAME for session. Old name: %s\n", rtp->rtcp->theircname);
}
More information about the asterisk-commits
mailing list