[asterisk-commits] oej: branch oej/pinefrog-rtcp-11 r386836 - /team/oej/pinefrog-rtcp-11/res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Apr 29 06:49:04 CDT 2013


Author: oej
Date: Mon Apr 29 06:49:00 2013
New Revision: 386836

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=386836
Log:
Prevent crash. A good thing (TM)

Modified:
    team/oej/pinefrog-rtcp-11/res/res_rtp_asterisk.c

Modified: team/oej/pinefrog-rtcp-11/res/res_rtp_asterisk.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/pinefrog-rtcp-11/res/res_rtp_asterisk.c?view=diff&rev=386836&r1=386835&r2=386836
==============================================================================
--- team/oej/pinefrog-rtcp-11/res/res_rtp_asterisk.c (original)
+++ team/oej/pinefrog-rtcp-11/res/res_rtp_asterisk.c Mon Apr 29 06:49:00 2013
@@ -3492,9 +3492,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);
@@ -3502,6 +3502,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