[svn-commits] alecdavis: branch 10 r363935 - in /branches/10: ./ channels/chan_sip.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Apr 26 04:46:51 CDT 2012


Author: alecdavis
Date: Thu Apr 26 04:46:38 2012
New Revision: 363935

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=363935
Log:
chan_sip: [general] maxforwards, not checked for a value greater than 255

The peer maxforwards is checked for both '< 1' and '> 255',
but the default 'maxforwards' in the [general] section is only checked for '< 1'

alecdavis (license 585)
Reported by: alecdavis
Tested by: alecdavis
 
Review: https://reviewboard.asterisk.org/r/1888/
........

Merged revisions 363934 from http://svn.asterisk.org/svn/asterisk/branches/1.8

Modified:
    branches/10/   (props changed)
    branches/10/channels/chan_sip.c

Propchange: branches/10/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: branches/10/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/branches/10/channels/chan_sip.c?view=diff&rev=363935&r1=363934&r2=363935
==============================================================================
--- branches/10/channels/chan_sip.c (original)
+++ branches/10/channels/chan_sip.c Thu Apr 26 04:46:38 2012
@@ -29568,7 +29568,8 @@
 		} else if (!strcasecmp(v->name, "use_q850_reason")) {
 			ast_set2_flag(&global_flags[1], ast_true(v->value), SIP_PAGE2_Q850_REASON);
 		} else if (!strcasecmp(v->name, "maxforwards")) {
-			if ((sscanf(v->value, "%30d", &sip_cfg.default_max_forwards) != 1) || (sip_cfg.default_max_forwards < 1)) {
+			if (sscanf(v->value, "%30d", &sip_cfg.default_max_forwards) != 1
+				|| sip_cfg.default_max_forwards < 1 || 255 < sip_cfg.default_max_forwards) {
 				ast_log(LOG_WARNING, "'%s' is not a valid maxforwards value at line %d.  Using default.\n", v->value, v->lineno);
 				sip_cfg.default_max_forwards = DEFAULT_MAX_FORWARDS;
 			}




More information about the svn-commits mailing list