MODAPP-228

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12480 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2009-03-06 14:12:32 +00:00
parent 1ea293ff56
commit ad6d584403
3 changed files with 3 additions and 3 deletions

View 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);

View 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);

View 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);