From bd06c9494b2c8ac18746e9ee613c1be08e539f1d Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Wed, 24 Jan 2007 00:17:50 +0000 Subject: [PATCH] Don't set a new value for the END_ variable on the channel before using the old value. If you do, it will lead to accessing a memory address that has been free()'d. (issue #8895, arkadia) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@51828 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- apps/app_while.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/app_while.c b/apps/app_while.c index 736038ecd8..1cd7834694 100644 --- a/apps/app_while.c +++ b/apps/app_while.c @@ -275,8 +275,8 @@ static int _while_exec(struct ast_channel *chan, void *data, int end) pbx_builtin_setvar_helper(chan, my_name, NULL); snprintf(end_varname,VAR_SIZE,"END_%s",varname); if ((goto_str=pbx_builtin_getvar_helper(chan, end_varname))) { - pbx_builtin_setvar_helper(chan, end_varname, NULL); ast_parseable_goto(chan, goto_str); + pbx_builtin_setvar_helper(chan, end_varname, NULL); } else { int pri = find_matching_endwhile(chan); if (pri > 0) {