diff options
Diffstat (limited to 'funcs/func_callerid.c')
-rw-r--r-- | funcs/func_callerid.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/funcs/func_callerid.c b/funcs/func_callerid.c index e026d67a9..c8fd1bb9e 100644 --- a/funcs/func_callerid.c +++ b/funcs/func_callerid.c @@ -60,7 +60,9 @@ static int callerid_read(struct ast_channel *chan, const char *cmd, char *data, { char *opt = data; - /* XXX we are not always clearing the buffer. Is this correct ? */ + if (!chan) + return -1; + if (strchr(opt, '|')) { char name[80], num[80]; @@ -116,7 +118,7 @@ static int callerid_read(struct ast_channel *chan, const char *cmd, char *data, static int callerid_write(struct ast_channel *chan, const char *cmd, char *data, const char *value) { - if (!value) + if (!value || !chan) return -1; if (!strncasecmp("all", data, 3)) { |