aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authormnicholson <mnicholson@f38db490-d61c-443f-a65b-d21fe96a405b>2011-07-08 19:54:23 +0000
committermnicholson <mnicholson@f38db490-d61c-443f-a65b-d21fe96a405b>2011-07-08 19:54:23 +0000
commit66a5c9a88c736b368b0eeae4a8f9bb6f90ee4495 (patch)
tree2b45f7ba863b9e0d0eb7d0e98b3aaa32f6b60693 /main
parent94bbe2a70165acb7af61ceab57ac1e3c4989f971 (diff)
Merged revisions 327106 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r327106 | mnicholson | 2011-07-08 14:52:51 -0500 (Fri, 08 Jul 2011) | 11 lines Reset our ast_str before passing it on to dialplan function backends. It is possible for a dialplan backend to not modify the given buffer or ast_str and still return success. This causes any previous value stored in the buffer to be used as if the new function call provided it. Some functions also append to the given buffer assuming it is empty. The test_substitution unit test has also been modified to detect this problem. (closes issue ASTERISK-17878) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@327107 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/pbx.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/main/pbx.c b/main/pbx.c
index 0059cbd0b..3cb9affeb 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -3663,9 +3663,9 @@ int ast_func_read2(struct ast_channel *chan, const char *function, struct ast_st
if (acfptr->mod) {
u = __ast_module_user_add(acfptr->mod, chan);
}
+ ast_str_reset(*str);
if (acfptr->read2) {
/* ast_str enabled */
- ast_str_reset(*str);
res = acfptr->read2(chan, copy, args, str, maxlen);
} else {
/* Legacy function pointer, allocate buffer for result */