[asterisk-commits] rmudgett: branch 1.8 r344715 - /branches/1.8/channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Nov 11 12:35:15 CST 2011


Author: rmudgett
Date: Fri Nov 11 12:35:09 2011
New Revision: 344715

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=344715
Log:
Check sip.conf maxforwards parameter for range 1 <= x <= 255.

JIRA AST-710

Modified:
    branches/1.8/channels/chan_sip.c

Modified: branches/1.8/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/channels/chan_sip.c?view=diff&rev=344715&r1=344714&r2=344715
==============================================================================
--- branches/1.8/channels/chan_sip.c (original)
+++ branches/1.8/channels/chan_sip.c Fri Nov 11 12:35:09 2011
@@ -27159,7 +27159,8 @@
 					peer->amaflags = format;
 				}
 			} else if (!strcasecmp(v->name, "maxforwards")) {
-				if ((sscanf(v->value, "%30d", &peer->maxforwards) != 1) || (peer->maxforwards < 1)) {
+				if (sscanf(v->value, "%30d", &peer->maxforwards) != 1
+					|| peer->maxforwards < 1 || 255 < peer->maxforwards) {
 					ast_log(LOG_WARNING, "'%s' is not a valid maxforwards value at line %d.  Using default.\n", v->value, v->lineno);
 					peer->maxforwards = sip_cfg.default_max_forwards;
 				}




More information about the asterisk-commits mailing list