Skip to content
Snippets Groups Projects
Commit 376bc46a authored by Russell Bryant's avatar Russell Bryant
Browse files

prevent copying of NULL (bug #4307)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5708 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent c4ebf00d
No related branches found
No related tags found
No related merge requests found
......@@ -52,12 +52,14 @@ static char *builtin_function_if(struct ast_channel *chan, char *cmd, char *data
*iffalse = '\0';
iffalse++;
}
} else
iffalse = "";
}
if (expr && iftrue) {
ret = ast_true(expr) ? iftrue : iffalse;
strncpy(buf, ret, len);
ret = buf;
if (ret) {
ast_copy_string(buf, ret, len);
ret = buf;
}
} else {
ast_log(LOG_WARNING, "Syntax $(if <expr>?[<truecond>][:<falsecond>])\n");
ret = NULL;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment