ensure result buffer is initialized (issue #5285)
authorKevin P. Fleming <kpfleming@digium.com>
Sun, 25 Sep 2005 20:47:00 +0000 (20:47 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Sun, 25 Sep 2005 20:47:00 +0000 (20:47 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6652 65c4cc65-6c06-0410-ace0-fbb531ad65f3

funcs/func_strings.c

index 77933b6..303ca77 100755 (executable)
@@ -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) 
 {
 
 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)) {
        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;
        }
                return buf;
        }
-       
+
        pbx_substitute_variables_helper(chan, data, buf, len - 1);
 
        return buf;
        pbx_substitute_variables_helper(chan, data, buf, len - 1);
 
        return buf;