]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
fix setlanguage seg fault (bug #2641)
authorRussell Bryant <russell@russellbryant.com>
Thu, 14 Oct 2004 22:39:40 +0000 (22:39 +0000)
committerRussell Bryant <russell@russellbryant.com>
Thu, 14 Oct 2004 22:39:40 +0000 (22:39 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/v1-0@4005 65c4cc65-6c06-0410-ace0-fbb531ad65f3

pbx.c

diff --git a/pbx.c b/pbx.c
index 04f1569769b36149a4e4c44f73972ae97c487298..ed8f6837485ab317a11346f0c69af0eee438d2bb 100755 (executable)
--- a/pbx.c
+++ b/pbx.c
@@ -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;
 }