From: Mark Michelson Date: Thu, 7 Aug 2008 19:58:32 +0000 (+0000) Subject: Don't allow Answer() to accept a negative argument. X-Git-Tag: 1.6.2.0-beta1~1474 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=316fb598d2ae9358a111001508e1cfbf3e398877;p=thirdparty%2Fasterisk.git Don't allow Answer() to accept a negative argument. Negative argument means an infinite delay and we don't want that. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@136635 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/pbx.c b/main/pbx.c index 3edea4e050..6968171f22 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -7655,6 +7655,10 @@ static int pbx_builtin_answer(struct ast_channel *chan, void *data) if ((chan->_state != AST_STATE_UP) && !ast_strlen_zero(data)) delay = atoi(data); + if (delay < 0) { + delay = 0; + } + return __ast_answer(chan, delay); }