aboutsummaryrefslogtreecommitdiffstats
path: root/funcs/func_timeout.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2007-04-19 02:30:18 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2007-04-19 02:30:18 +0000
commit1ce325d67c86bf63786232d01a272436f0a38cd2 (patch)
treeb5d65fded5a96a7ee2dddaae0f9153ad01fa2d24 /funcs/func_timeout.c
parent5ae8e3ac4214197fec6ef999a6c50123be671979 (diff)
Bug 9557 - Specifying the GetVar AMI action without a Channel parameter can
cause Asterisk to crash. The reason this needs to be fixed in the functions instead of in AMI is because Channel can legitimately be NULL, such as when retrieving global variables. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@61680 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'funcs/func_timeout.c')
-rw-r--r--funcs/func_timeout.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/funcs/func_timeout.c b/funcs/func_timeout.c
index 5983617aa..95490594e 100644
--- a/funcs/func_timeout.c
+++ b/funcs/func_timeout.c
@@ -42,6 +42,9 @@ static char *builtin_function_timeout_read(struct ast_channel *chan, char *cmd,
{
time_t myt;
+ if (!chan)
+ return "";
+
if (!data) {
ast_log(LOG_ERROR, "Must specify type of timeout to get.\n");
return NULL;
@@ -86,6 +89,9 @@ static void builtin_function_timeout_write(struct ast_channel *chan, char *cmd,
char timestr[64];
struct tm myt;
+ if (!chan)
+ return;
+
if (!data) {
ast_log(LOG_ERROR, "Must specify type of timeout to set.\n");
return;