mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 20:20:07 +00:00
ensure result buffer is initialized (issue #5285)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6652 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -186,11 +186,13 @@ struct ast_custom_function strftime_function = {
|
||||
|
||||
static char *function_eval(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len)
|
||||
{
|
||||
memset(buf, 0, len);
|
||||
|
||||
if (!data || ast_strlen_zero(data)) {
|
||||
ast_log(LOG_WARNING, "EVAL requires an argument: EVAL(<variable>)\n");
|
||||
ast_log(LOG_WARNING, "EVAL requires an argument: EVAL(<string>)\n");
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
||||
pbx_substitute_variables_helper(chan, data, buf, len - 1);
|
||||
|
||||
return buf;
|
||||
|
Reference in New Issue
Block a user