提交 cf32d24b authored 作者: Anthony Minessale's avatar Anthony Minessale

FS-4860 --resolve This seems to have come from a malformed file_string in the ringback var

上级 1f06fe90
......@@ -4476,8 +4476,13 @@ static switch_status_t next_file(switch_file_handle_t *handle)
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error finding the folder path section in '%s'\n", path);
}
}
if (switch_file_exists(file, handle->memory_pool) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "File [%s] does not exist.\n", file);
goto top;
}
if (switch_core_file_open(&context->fh, file, handle->channels, handle->samplerate, handle->flags, NULL) != SWITCH_STATUS_SUCCESS) {
goto top;
}
......
......@@ -76,6 +76,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_perform_file_open(const char *file,
switch_set_flag(fh, SWITCH_FILE_FLAG_FREE_POOL);
}
if (switch_directory_exists(file_path, fh->memory_pool) == SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "File [%s] is a directory not a file.\n", file_path);
goto fail;
}
if ((rhs = strstr(file_path, SWITCH_URL_SEPARATOR))) {
switch_copy_string(stream_name, file_path, (rhs + 1) - file_path);
......@@ -198,6 +202,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_perform_file_open(const char *file,
fail:
switch_clear_flag(fh, SWITCH_FILE_OPEN);
if (switch_test_flag(fh, SWITCH_FILE_FLAG_FREE_POOL)) {
switch_core_destroy_memory_pool(&fh->memory_pool);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论