[asterisk-commits] alecdavis: trunk r363936 - in /trunk: ./ channels/chan_sip.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Apr 26 04:49:04 CDT 2012
Author: alecdavis
Date: Thu Apr 26 04:48:55 2012
New Revision: 363936
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=363936
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
........
Merged revisions 363935 from http://svn.asterisk.org/svn/asterisk/branches/10
Modified:
trunk/ (props changed)
trunk/channels/chan_sip.c
Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-10-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=363936&r1=363935&r2=363936
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Thu Apr 26 04:48:55 2012
@@ -29819,7 +29819,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 asterisk-commits
mailing list