mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-30 02:26:23 +00:00
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 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@363936 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -29819,7 +29819,8 @@ static int reload_config(enum channelreloadreason reason)
|
|||||||
} else if (!strcasecmp(v->name, "use_q850_reason")) {
|
} else if (!strcasecmp(v->name, "use_q850_reason")) {
|
||||||
ast_set2_flag(&global_flags[1], ast_true(v->value), SIP_PAGE2_Q850_REASON);
|
ast_set2_flag(&global_flags[1], ast_true(v->value), SIP_PAGE2_Q850_REASON);
|
||||||
} else if (!strcasecmp(v->name, "maxforwards")) {
|
} 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);
|
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;
|
sip_cfg.default_max_forwards = DEFAULT_MAX_FORWARDS;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user