From dda0ab236d9730ac36fc1631eb4ef802c8ce4a0c Mon Sep 17 00:00:00 2001 From: Alexander Traud Date: Fri, 5 Jan 2018 13:42:07 +0100 Subject: chan_ooh323: Limit outgoinglimit to positive values as intended. ASTERISK-27552 Change-Id: Ifbf9d51e7374ca2e8b27ec568f6770050fc1a854 --- addons/chan_ooh323.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/addons/chan_ooh323.c b/addons/chan_ooh323.c index 285ed2849..3afcecd96 100644 --- a/addons/chan_ooh323.c +++ b/addons/chan_ooh323.c @@ -2604,9 +2604,12 @@ static struct ooh323_peer *build_peer(const char *name, struct ast_variable *v, } } else if (!strcasecmp(v->name, "outgoinglimit")) { - peer->outgoinglimit = atoi(v->value); - if (peer->outgoinglimit < 0) + int val = atoi(v->value); + if (val < 0) { peer->outgoinglimit = 0; + } else { + peer->outgoinglimit = val; + } } else if (!strcasecmp(v->name, "accountcode")) { ast_copy_string(peer->accountcode, v->value, sizeof(peer->accountcode)); } else if (!strcasecmp(v->name, "faststart")) { -- cgit v1.2.3