From: Russell Bryant Date: Fri, 27 Apr 2007 16:14:11 +0000 (+0000) Subject: If no variables were passed into pbx_substitute_variables_helper_full(), then X-Git-Tag: 1.4.4~6 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a53ebcf5460882ca75a41bffca1cdd27af08c83e;p=thirdparty%2Fasterisk.git If no variables were passed into pbx_substitute_variables_helper_full(), then don't even bother creating a temporary bogus channel, since that is only for allowing certain functions to operate on the variables as if they were on a channel. Most importantly, this fixes a crash. (issue #9613, reported by callguy, fixed by me) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@62171 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/pbx.c b/main/pbx.c index 1f6ccbd46c..5a9d768d4d 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -1642,7 +1642,7 @@ static void pbx_substitute_variables_helper_full(struct ast_channel *c, struct v parse_variable_name(vars, &offset, &offset2, &isfunction); if (isfunction) { /* Evaluate function */ - if (c) + if (c || !headp) cp4 = ast_func_read(c, vars, workspace, VAR_BUF_SIZE) ? NULL : workspace; else { struct varshead old;