[svn-commits] kmoore: trunk r373212 - in /trunk: ./ channels/chan_sip.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Sep 20 08:04:26 CDT 2012


Author: kmoore
Date: Thu Sep 20 08:04:22 2012
New Revision: 373212

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=373212
Log:
Correct handling of unknown SDP stream types

When the patch to handle arbitrary SDP stream arrangements went into
Asterisk, it also included an ability to transparently decline unknown
stream types. The scanf calls used were not checked properly causing
this part of the functionality to be broken.

(closes issue ASTERISK-20203)
........

Merged revisions 373211 from http://svn.asterisk.org/svn/asterisk/branches/11

Modified:
    trunk/   (props changed)
    trunk/channels/chan_sip.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.

Modified: trunk/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_sip.c?view=diff&rev=373212&r1=373211&r2=373212
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Thu Sep 20 08:04:22 2012
@@ -9871,10 +9871,8 @@
 			}
 		} else {
 			char type[20] = {0,};
-			char *typelen = strchr(m, ' ');
-			if (typelen && typelen - m < 20 &&
-			    ((sscanf(m, "%s %30u/%30u %n", type, &x, &numberofports, &len) == 2 && len > 0) ||
-			     (sscanf(m, "%s %30u %n", type, &x, &len) == 1 && len > 0))) {
+			if ((sscanf(m, "%19s %30u/%30u %n", type, &x, &numberofports, &len) == 3 && len > 0) ||
+			     (sscanf(m, "%19s %30u %n", type, &x, &len) == 2 && len > 0)) {
 				/* produce zero-port m-line since it may be needed later
 				 * length is "m=" + type + " 0 " + remainder + "\0" */
 				if (!(offer->decline_m_line = ast_malloc(2 + strlen(type) + 3 + strlen(m + len) + 1))) {




More information about the svn-commits mailing list