summaryrefslogtreecommitdiff
path: root/pbx.c
diff options
context:
space:
mode:
authorJames Golovich <james@gnuinter.net>2004-10-13 22:47:42 +0000
committerJames Golovich <james@gnuinter.net>2004-10-13 22:47:42 +0000
commit8b8d26f9bc4996c725061a27e351698fd64cd825 (patch)
tree4eb8f9fc181bdc2ba156c858dde38a2d3401757c /pbx.c
parent3673eeb23f618410e2126f5174c066539894207d (diff)
Fix pbx_builtin_setlanguage to not seg when data is a NULL ptr. Also fix AGI so we dont run into this with other specific problems as well. (bug 2641)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3990 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'pbx.c')
-rwxr-xr-xpbx.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/pbx.c b/pbx.c
index 4010411cc..26a3e021e 100755
--- a/pbx.c
+++ b/pbx.c
@@ -4483,7 +4483,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;
}