提交 c7709a19 authored 作者: Michael Jerris's avatar Michael Jerris

CID-1294436: handle null file paths to switch_is_file_path correctly

上级 91a6fc82
......@@ -1079,6 +1079,10 @@ static inline switch_bool_t switch_is_file_path(const char *file)
const char *e;
int r;
if (zstr(file)) {
return SWITCH_FALSE;
}
while(*file == '{') {
if ((e = switch_find_end_paren(file, '{', '}'))) {
file = e + 1;
......@@ -1087,13 +1091,12 @@ static inline switch_bool_t switch_is_file_path(const char *file)
}
#ifdef WIN32
r = (file && (*file == '\\' || *(file + 1) == ':' || *file == '/' || strstr(file, SWITCH_URL_SEPARATOR)));
r = (*file == '\\' || *(file + 1) == ':' || *file == '/' || strstr(file, SWITCH_URL_SEPARATOR));
#else
r = (file && ((*file == '/') || strstr(file, SWITCH_URL_SEPARATOR)));
r = ((*file == '/') || strstr(file, SWITCH_URL_SEPARATOR));
#endif
return r ? SWITCH_TRUE : SWITCH_FALSE;
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论