mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
Check sip.conf maxforwards parameter for range 1 <= x <= 255.
JIRA AST-710 ........ Merged revisions 344715 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 344716 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@344717 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -27939,7 +27939,8 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, str
|
||||
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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user