mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-23 14:44:28 +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:
@@ -36,14 +36,14 @@
|
||||
|
||||
static char *builtin_function_language_read(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len)
|
||||
{
|
||||
ast_copy_string(buf, chan->language, len);
|
||||
ast_copy_string(buf, chan ? chan->language : "", len);
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
static void builtin_function_language_write(struct ast_channel *chan, char *cmd, char *data, const char *value)
|
||||
{
|
||||
if (value)
|
||||
if (chan && value)
|
||||
ast_copy_string(chan->language, value, sizeof(chan->language));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user