[asterisk-commits] oej: branch group/pinefrog-rtcp-trunk r386837 - /team/group/pinefrog-rtcp-tru...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Apr 29 07:24:37 CDT 2013


Author: oej
Date: Mon Apr 29 07:24:34 2013
New Revision: 386837

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=386837
Log:
Prevent crashes.

Modified:
    team/group/pinefrog-rtcp-trunk/res/res_rtp_asterisk.c

Modified: team/group/pinefrog-rtcp-trunk/res/res_rtp_asterisk.c
URL: http://svnview.digium.com/svn/asterisk/team/group/pinefrog-rtcp-trunk/res/res_rtp_asterisk.c?view=diff&rev=386837&r1=386836&r2=386837
==============================================================================
--- team/group/pinefrog-rtcp-trunk/res/res_rtp_asterisk.c (original)
+++ team/group/pinefrog-rtcp-trunk/res/res_rtp_asterisk.c Mon Apr 29 07:24:34 2013
@@ -3539,9 +3539,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);
@@ -3549,6 +3549,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