mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-11 12:28:27 +00:00
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: https://origsvn.digium.com/svn/asterisk/branches/1.2@61680 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -44,7 +44,7 @@ static char *builtin_function_cdr_read(struct ast_channel *chan, char *cmd, char
|
||||
int argc;
|
||||
char *argv[2];
|
||||
int recursive = 0;
|
||||
struct ast_cdr *cdr = chan->cdr;
|
||||
struct ast_cdr *cdr = chan ? chan->cdr : NULL;
|
||||
|
||||
if (ast_strlen_zero(data))
|
||||
return NULL;
|
||||
@@ -78,9 +78,9 @@ static void builtin_function_cdr_write(struct ast_channel *chan, char *cmd, char
|
||||
char *argv[2];
|
||||
int recursive = 0;
|
||||
|
||||
if (ast_strlen_zero(data) || !value)
|
||||
if (ast_strlen_zero(data) || !value || !chan)
|
||||
return;
|
||||
|
||||
|
||||
mydata = ast_strdupa(data);
|
||||
argc = ast_app_separate_args(mydata, '|', argv, sizeof(argv) / sizeof(argv[0]));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user