From: Kevin P. Fleming Date: Sun, 25 Sep 2005 20:47:00 +0000 (+0000) Subject: ensure result buffer is initialized (issue #5285) X-Git-Tag: 1.2.0-beta2~267 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d612e3bc27c7f9eca6d9b36b6d41f5ca2d980262;p=thirdparty%2Fasterisk.git ensure result buffer is initialized (issue #5285) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6652 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/funcs/func_strings.c b/funcs/func_strings.c index 77933b6dbf..303ca77d76 100755 --- a/funcs/func_strings.c +++ b/funcs/func_strings.c @@ -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()\n"); + ast_log(LOG_WARNING, "EVAL requires an argument: EVAL()\n"); return buf; } - + pbx_substitute_variables_helper(chan, data, buf, len - 1); return buf;