aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_externalivr.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-04-30 19:21:04 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-04-30 19:21:04 +0000
commit712c72b0df2fb7badefffb68c319f4a105ae9c71 (patch)
tree89d592fc9e276ed41a21062589ea44fedcf6d0d2 /apps/app_externalivr.c
parent829d44846c2cbb8f568e5368c8e033daba211ae0 (diff)
Lock around variables retrieved, and copy the values, if they stay persistent,
since another thread could remove them. (closes issue #12541) Reported by: snuffy Patches: bug_12156_apps.diff uploaded by snuffy (license 35) Several additional changes by me git-svn-id: http://svn.digium.com/svn/asterisk/trunk@114904 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_externalivr.c')
-rw-r--r--apps/app_externalivr.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/apps/app_externalivr.c b/apps/app_externalivr.c
index 3bf7dd1c7..a93abb4a8 100644
--- a/apps/app_externalivr.c
+++ b/apps/app_externalivr.c
@@ -251,10 +251,13 @@ static void ast_eivr_getvariable(struct ast_channel *chan, char *data, char *out
break;
}
- value = pbx_builtin_getvar_helper(chan, variable);
- if(!value)
+ ast_channel_lock(chan);
+ if (!(value = pbx_builtin_getvar_helper(chan, variable))) {
value = "";
+ }
+
ast_str_append(&newstring, 0, "%s=%s,", variable, value);
+ ast_channel_unlock(chan);
ast_copy_string(outbuf, newstring->str, outbuflen);
}
};