]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
switch_ivr_play_say: Fix a segfault when using <nomatch/> in phrases
authorMarc Olivier Chouinard <mochouinard@moctel.com>
Sun, 21 Feb 2010 08:45:38 +0000 (08:45 +0000)
committerMarc Olivier Chouinard <mochouinard@moctel.com>
Sun, 21 Feb 2010 08:45:38 +0000 (08:45 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16711 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_ivr_play_say.c

index df73fa799bdb2c3be1f0f60ce446a8db1e5a7e6b..19eb38f5eab609ff5416a7ab8d8fecd921391682 100644 (file)
@@ -248,7 +248,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) * 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);