From 008930a3f20e68083837aef16e72551b71dbd221 Mon Sep 17 00:00:00 2001
From: Russell Bryant <russell@russellbryant.com>
Date: Sat, 20 Mar 2010 16:50:38 +0000
Subject: [PATCH] Fix memory corruption found by unit tests.

ast_str_reset() was being called on a potentially uninitialized pointer.
Valgrind is my hero, once again.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@253579 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 funcs/func_strings.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/funcs/func_strings.c b/funcs/func_strings.c
index fa0174c60d..184300d25e 100644
--- a/funcs/func_strings.c
+++ b/funcs/func_strings.c
@@ -525,7 +525,7 @@ static int listfilter(struct ast_channel *chan, const char *cmd, char *parse, ch
 
 	flen = strlen(args.fieldvalue);
 
-	ast_str_reset(result);
+	ast_str_reset(*result_ptr);
 	/* Enough space for any result */
 	if (len > -1) {
 		ast_str_make_space(result_ptr, len ? len : ast_str_strlen(orig_list) + 1);
-- 
GitLab