Revision
16711
Author
mochouinard
Date
2010-02-21 02:45:38 -0600 (Sun, 21 Feb 2010)

Log Message

switch_ivr_play_say: Fix a segfault when using <nomatch/> in phrases

Modified Paths

Diff

Modified: freeswitch/trunk/src/switch_ivr_play_say.c (16710 => 16711)


--- freeswitch/trunk/src/switch_ivr_play_say.c	2010-02-20 13:28:42 UTC (rev 16710)
+++ freeswitch/trunk/src/switch_ivr_play_say.c	2010-02-21 08:45:38 UTC (rev 16711)
@@ -248,7 +248,7 @@
 					char *func = (char *) switch_xml_attr_soft(action, "function");
 
 					if (strchr(pattern, '(') && strchr(adata, '$')) {
-						len = (uint32_t) (strlen(data) + strlen(adata) + 10) * proceed;
+						len = (uint32_t) (strlen(data) + strlen(adata) + 10) * (proceed ? proceed : 1);
 						if (!(substituted = malloc(len))) {
 							switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Memory Error!\n");
 							switch_regex_safe_free(re);