summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2008-08-07 19:58:32 +0000
committerMark Michelson <mmichelson@digium.com>2008-08-07 19:58:32 +0000
commit316fb598d2ae9358a111001508e1cfbf3e398877 (patch)
tree455d3047d517a1d4d47dc06cd39e12743e76b236
parent9b5b8246c566d6fc30cf3ef68701fcc1981defc2 (diff)
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
-rw-r--r--main/pbx.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/main/pbx.c b/main/pbx.c
index 3edea4e05..6968171f2 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);
}