diff options
Diffstat (limited to 'Build/source')
-rw-r--r-- | Build/source/texk/kpathsea/ChangeLog | 5 | ||||
-rw-r--r-- | Build/source/texk/kpathsea/knj.c | 26 | ||||
-rw-r--r-- | Build/source/texk/kpathsea/readable.c | 13 |
3 files changed, 44 insertions, 0 deletions
diff --git a/Build/source/texk/kpathsea/ChangeLog b/Build/source/texk/kpathsea/ChangeLog index e6e3b70c4d1..a4d3b1b64ea 100644 --- a/Build/source/texk/kpathsea/ChangeLog +++ b/Build/source/texk/kpathsea/ChangeLog @@ -1,3 +1,8 @@ +2020-10-24 Akira Kakuto <kakuto@w32tex.org> + + * readable.c, knj.c: More than one directory separators in + filename+2 should not exist in \\?\ form of absolute path. + 2020-08-26 Karl Berry <karl@tug.org> * texmf.cnf (save_size): double to 200,000. Needed with diff --git a/Build/source/texk/kpathsea/knj.c b/Build/source/texk/kpathsea/knj.c index 9440438b0f5..0498319c606 100644 --- a/Build/source/texk/kpathsea/knj.c +++ b/Build/source/texk/kpathsea/knj.c @@ -127,12 +127,25 @@ kpathsea_fsyscp_xfopen (kpathsea kpse, const char *filename, const char *mode) Windows, if it really exists and input name is given in full-absolute path in a command line. /./ , /../, \.\, \..\ should be excluded. (2020/06/06) + More than one directory separators should be excluded. (2020/10/24) */ fnn = xmalloc(len + 10); p = strstr(filename, ".\\"); if (!p) { p = strstr(filename, "./"); } + if (!p && len > 2) { + p = strstr(filename + 2, "//"); + } + if (!p && len > 2) { + p = strstr(filename + 2, "\\\\"); + } + if (!p && len > 2) { + p = strstr(filename + 2, "\\/"); + } + if (!p && len > 2) { + p = strstr(filename + 2, "/\\"); + } if (!p && len > 2 && ((filename[0] == '/' && filename[1] == '/') || (filename[0] == '\\' && filename[1] == '\\' && filename[2] != '?'))) { @@ -192,12 +205,25 @@ kpathsea_fsyscp_fopen (kpathsea kpse, const char *filename, const char *mode) Windows, if it really exists and input name is given in full-absolute path in a command line. /./ , /../, \.\, \..\ should be excluded. (2020/06/06) + More than one directory separators should be excluded. (2020/10/24) */ fnn = xmalloc(len + 10); p = strstr(filename, ".\\"); if (!p) { p = strstr(filename, "./"); } + if (!p && len > 2) { + p = strstr(filename + 2, "//"); + } + if (!p && len > 2) { + p = strstr(filename + 2, "\\\\"); + } + if (!p && len > 2) { + p = strstr(filename + 2, "\\/"); + } + if (!p && len > 2) { + p = strstr(filename + 2, "/\\"); + } if (!p && len > 2 && ((filename[0] == '/' && filename[1] == '/') || (filename[0] == '\\' && filename[1] == '\\' && filename[2] != '?'))) { diff --git a/Build/source/texk/kpathsea/readable.c b/Build/source/texk/kpathsea/readable.c index dc83f36bd28..182a5e69a16 100644 --- a/Build/source/texk/kpathsea/readable.c +++ b/Build/source/texk/kpathsea/readable.c @@ -51,11 +51,24 @@ READABLE(kpathsea kpse, const_string fn, unsigned int st) Windows, if it really exists and input name is given in full-absolute path in a command line. /../, /./, \..\, \.\ should be excluded (2020/06/06) + More than one directory separators should be excluded. (2020/10/24) */ p = strstr(fn, ".\\"); if (!p) { p = strstr(fn, "./"); } + if (!p && len > 2) { + p = strstr(fn + 2, "//"); + } + if (!p && len > 2) { + p = strstr(fn + 2, "\\\\"); + } + if (!p && len > 2) { + p = strstr(fn + 2, "\\/"); + } + if (!p && len > 2) { + p = strstr(fn + 2, "/\\"); + } if (!p && len > 2 && ((fn[0] == '/' && fn[1] == '/') || (fn[0] == '\\' && fn[1] == '\\' && fn[2] != '?'))) { fn += 2; |