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:
Tilghman Lesher
2007-04-19 02:30:18 +00:00
parent 062368a175
commit e4467b3837
6 changed files with 22 additions and 9 deletions

View File

@@ -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));
}