[asterisk-commits] russell: trunk r62416 - /trunk/channels/chan_sip.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon Apr 30 08:37:24 MST 2007


Author: russell
Date: Mon Apr 30 10:37:23 2007
New Revision: 62416

URL: http://svn.digium.com/view/asterisk?view=rev&rev=62416
Log:
Don't crash when invalid arguments are provided to the CHANNEL() function
for a SIP channel.
(issue #9619, reported by jtodd, original patch by Corydon76, committed patch
 slightly modified by me)

Modified:
    trunk/channels/chan_sip.c

Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?view=diff&rev=62416&r1=62415&r2=62416
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Mon Apr 30 10:37:23 2007
@@ -14911,11 +14911,14 @@
 		return 0;
 	}
 
-	if (strcasecmp(args.param, "rtpqos"))
-		return 0;
+	if (ast_strlen_zero(args.param) || strcasecmp(args.param, "rtpqos"))
+		return -1;
 
 	memset(buf, 0, buflen);
 	memset(&qos, 0, sizeof(qos));
+
+	if (ast_strlen_zero(args.type))
+		return -1;
 
 	if (strcasecmp(args.type, "AUDIO") == 0) {
 		all = ast_rtp_get_quality(p->rtp, &qos);
@@ -14924,6 +14927,9 @@
 	} else if (strcasecmp(args.type, "TEXT") == 0) {
 		all = ast_rtp_get_quality(p->trtp, &qos);
 	}
+
+	if (ast_strlen_zero(args.field))
+		return -1;
 
 	if (strcasecmp(args.field, "local_ssrc") == 0)
 		snprintf(buf, buflen, "%u", qos.local_ssrc);



More information about the asterisk-commits mailing list