From: Dragos Oancea Date: Tue, 15 Mar 2022 16:47:06 +0000 (+0200) Subject: [mod_local_stream] fix path with ".loc" file extension. X-Git-Tag: v1.10.8^2~67^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1577%2Fhead;p=thirdparty%2Ffreeswitch.git [mod_local_stream] fix path with ".loc" file extension. --- diff --git a/src/mod/formats/mod_local_stream/mod_local_stream.c b/src/mod/formats/mod_local_stream/mod_local_stream.c index a38411e954..2587313c36 100644 --- a/src/mod/formats/mod_local_stream/mod_local_stream.c +++ b/src/mod/formats/mod_local_stream/mod_local_stream.c @@ -311,6 +311,7 @@ static void *SWITCH_THREAD_FUNC read_stream_thread(switch_thread_t *thread, void switch_size_t olen; const char *artist = NULL, *title = NULL; char tmp_space[128] = ""; + const char *l; if (fd > -1) { char *pb; @@ -330,7 +331,7 @@ static void *SWITCH_THREAD_FUNC read_stream_thread(switch_thread_t *thread, void switch_snprintf(path_buf, sizeof(path_buf), "%s%s%s", source->location, SWITCH_PATH_SEPARATOR, fname); - if (switch_stristr(".loc", path_buf)) { + if ((l = switch_stristr(".loc", fname)) && (l == fname + strlen(fname) - 4)) { if ((fd = open(path_buf, O_RDONLY)) < 0) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't open %s\n", fname); switch_yield(1000000);