[asterisk-commits] sgriepentrog: branch 12 r414216 - in /branches/12: ./ funcs/func_strings.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed May 21 14:07:43 CDT 2014


Author: sgriepentrog
Date: Wed May 21 14:07:35 2014
New Revision: 414216

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=414216
Log:
pbx.c: prevent potential crash from recursive replace()

Recurisve usage of replace() resulted in corruption of the
temporary string storage and potential crash.  By changing
the string to be allocated separtely per instance, this is
eliminated.

ASTERISK-23650 #comment Reported by: Roel van Meer
ASTEIRSK-23650 #close

Review: https://reviewboard.asterisk.org/r/3539/
........

Merged revisions 414214 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 414215 from http://svn.asterisk.org/svn/asterisk/branches/11

Modified:
    branches/12/   (props changed)
    branches/12/funcs/func_strings.c

Propchange: branches/12/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.

Modified: branches/12/funcs/func_strings.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/funcs/func_strings.c?view=diff&rev=414216&r1=414215&r2=414216
==============================================================================
--- branches/12/funcs/func_strings.c (original)
+++ branches/12/funcs/func_strings.c Wed May 21 14:07:35 2014
@@ -798,7 +798,7 @@
 		AST_APP_ARG(replace);
 	);
 	char *strptr, *varsubst;
-	struct ast_str *str = ast_str_thread_get(&result_buf, 16);
+	RAII_VAR(struct ast_str *, str, ast_str_create(16), ast_free);
 	char find[256]; /* Only 256 characters possible */
 	char replace[2] = "";
 	size_t unused;




More information about the asterisk-commits mailing list