[Freeswitch-svn] [commit] r12480 - in freeswitch/trunk/src: . mod/applications/mod_commands mod/languages/mod_spidermonkey

FreeSWITCH SVN anthm at freeswitch.org
Fri Mar 6 06:12:32 PST 2009


Author: anthm
Date: Fri Mar  6 08:12:32 2009
New Revision: 12480

Log:
MODAPP-228

Modified:
   freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c
   freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
   freeswitch/trunk/src/switch_ivr_play_say.c

Modified: freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c	(original)
+++ freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c	Fri Mar  6 08:12:32 2009
@@ -777,7 +777,7 @@
 
 	if ((proceed = switch_regex_perform(argv[0], argv[1], &re, ovector, sizeof(ovector) / sizeof(ovector[0])))) {
 		if (argc > 2) {
-			len = strlen(argv[0]) * 3;
+			len = (strlen(argv[0]) + strlen(argv[2]) + 10) * proceed;
 			substituted = malloc(len);
 			switch_assert(substituted);
 			memset(substituted, 0, len);

Modified: freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c	(original)
+++ freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c	Fri Mar  6 08:12:32 2009
@@ -403,7 +403,7 @@
 	if (argc > 0) {
 		uint32_t len;
 		subst_string = JS_GetStringBytes(JS_ValueToString(cx, argv[0]));
-		len = (uint32_t) (strlen(pcre_obj->string) + strlen(subst_string) + 10);
+		len = (uint32_t) (strlen(pcre_obj->string) + strlen(subst_string) + 10) * pcre_obj->proceed;
 		substituted = malloc(len);
 		switch_assert(substituted != NULL);
 		switch_perform_substitution(pcre_obj->re, pcre_obj->proceed, subst_string, pcre_obj->string, substituted, len, pcre_obj->ovector);

Modified: freeswitch/trunk/src/switch_ivr_play_say.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_play_say.c	(original)
+++ freeswitch/trunk/src/switch_ivr_play_say.c	Fri Mar  6 08:12:32 2009
@@ -247,7 +247,7 @@
 					char *func = (char *) switch_xml_attr_soft(action, "function");
 
 					if (strchr(pattern, '(') && strchr(adata, '$')) {
-						len = (uint32_t) (strlen(data) + strlen(adata) + 10);
+						len = (uint32_t) (strlen(data) + strlen(adata) + 10) * proceed;
 						if (!(substituted = malloc(len))) {
 							switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Memory Error!\n");
 							switch_regex_safe_free(re);



More information about the Freeswitch-svn mailing list