From: Richard Mudgett Date: Fri, 11 Nov 2011 18:35:09 +0000 (+0000) Subject: Check sip.conf maxforwards parameter for range 1 <= x <= 255. X-Git-Tag: 1.8.9.0-rc1~82 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=85970b9b3bbec87bca7d41d6bf5633328e5cb873;p=thirdparty%2Fasterisk.git Check sip.conf maxforwards parameter for range 1 <= x <= 255. JIRA AST-710 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@344715 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index b098570519..bdf948ace8 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -27159,7 +27159,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; }