dect
/
asterisk
Archived
13
0
Fork 0

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: http://svn.digium.com/svn/asterisk/trunk@3990 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
citats 2004-10-13 22:47:42 +00:00
parent 0c58b05560
commit 329d3fc98e
2 changed files with 3 additions and 2 deletions

3
pbx.c
View File

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

View File

@ -827,7 +827,7 @@ static int handle_exec(struct ast_channel *chan, AGI *agi, int argc, char **argv
app = pbx_findapp(argv[1]);
if (app) {
res = pbx_exec(chan, app, argv[2], 1);
res = pbx_exec(chan, app, argv[2] ? argv[2] : NULL, 1);
} else {
ast_log(LOG_WARNING, "Could not find application (%s)\n", argv[1]);
res = -2;