fix setlanguage seg fault (bug #2641)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/v1-0@4005 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant
2004-10-14 22:39:40 +00:00
parent 8bccbf9afb
commit 663636b515

3
pbx.c
View File

@@ -4381,7 +4381,8 @@ static int pbx_builtin_answer(struct ast_channel *chan, void *data)
static int pbx_builtin_setlanguage(struct ast_channel *chan, void *data)
{
/* Copy the language as specified */
strncpy(chan->language, (char *)data, sizeof(chan->language)-1);
if (data)
strncpy(chan->language, (char *)data, sizeof(chan->language)-1);
return 0;
}