Don't allow Answer() to accept a negative argument.
authorMark Michelson <mmichelson@digium.com>
Thu, 7 Aug 2008 19:58:32 +0000 (19:58 +0000)
committerMark Michelson <mmichelson@digium.com>
Thu, 7 Aug 2008 19:58:32 +0000 (19:58 +0000)
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

main/pbx.c

index 3edea4e..6968171 100644 (file)
@@ -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);
 }