]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
MODAPP-228
authorAnthony Minessale <anthony.minessale@gmail.com>
Fri, 6 Mar 2009 14:12:32 +0000 (14:12 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Fri, 6 Mar 2009 14:12:32 +0000 (14:12 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12480 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/applications/mod_commands/mod_commands.c
src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
src/switch_ivr_play_say.c

index dba97c936aecc577f891f193c1e9f647fff0685d..50759fe607a7f32b1a8c3ecded6bc44aa159ff73 100644 (file)
@@ -777,7 +777,7 @@ SWITCH_STANDARD_API(regex_function)
 
        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);
index 36d2c207df69a11d74020fc849bca491c45e1644..64051eefdb49fca43578986382c4f537fb33458c 100644 (file)
@@ -403,7 +403,7 @@ static JSBool pcre_substitute(JSContext * cx, JSObject * obj, uintN argc, jsval
        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);
index c61c68cd92aa2d21fdea3b1ce4d392d45a89ea90..9cf086b9eb7e0bc03e0462b67f02e42a5e2e56a9 100644 (file)
@@ -247,7 +247,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro(switch_core_session_t *s
                                        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);