texlive[55430] Build/source/texk/kpathsea: /../, /./, \..\, \.\

commits+kakuto at tug.org commits+kakuto at tug.org
Sat Jun 6 07:19:02 CEST 2020


Revision: 55430
          http://tug.org/svn/texlive?view=revision&revision=55430
Author:   kakuto
Date:     2020-06-06 07:19:02 +0200 (Sat, 06 Jun 2020)
Log Message:
-----------
/../, /./, \..\, \.\ should not exist in \\?\ form of absolute path.

Modified Paths:
--------------
    trunk/Build/source/texk/kpathsea/ChangeLog
    trunk/Build/source/texk/kpathsea/knj.c
    trunk/Build/source/texk/kpathsea/readable.c

Modified: trunk/Build/source/texk/kpathsea/ChangeLog
===================================================================
--- trunk/Build/source/texk/kpathsea/ChangeLog	2020-06-05 23:56:02 UTC (rev 55429)
+++ trunk/Build/source/texk/kpathsea/ChangeLog	2020-06-06 05:19:02 UTC (rev 55430)
@@ -1,3 +1,8 @@
+2020-06-06  Akira Kakuto  <kakuto at w32tex.org>
+
+	* readable.c, knj.c: /../, /./, \..\, \.\ should not exist
+	in \\?\ form of absolute path.
+
 2020-04-28  Akira Kakuto  <kakuto at w32tex.org>
 
 	* readable.c, knj.c: Support very long input path name,

Modified: trunk/Build/source/texk/kpathsea/knj.c
===================================================================
--- trunk/Build/source/texk/kpathsea/knj.c	2020-06-05 23:56:02 UTC (rev 55429)
+++ trunk/Build/source/texk/kpathsea/knj.c	2020-06-06 05:19:02 UTC (rev 55430)
@@ -126,15 +126,20 @@
   Support very long input path name, longer than _MAX_PATH for
   Windows, if it really exists and input name is given in
   full-absolute path in a command line.
+  /./ , /../, \.\, \..\ should be excluded. (2020/06/06)
 */
     fnn = xmalloc(len + 10);
-    if (len > 2 && ((filename[0] == '/' && filename[1] == '/') ||
+    p = strstr(filename, ".\\");
+    if (!p) {
+       p = strstr(filename, "./");
+    }
+    if (!p && len > 2 && ((filename[0] == '/' && filename[1] == '/') ||
         (filename[0] == '\\' && filename[1] == '\\' &&
          filename[2] != '?'))) {
        filename += 2;
        strcpy (fnn, "\\\\?\\UNC\\");
        strcat (fnn, filename);
-    } else if (len > 2 && filename[1] == ':') {
+    } else if (!p && len > 2 && filename[1] == ':') {
        strcpy (fnn, "\\\\?\\");
        strcat (fnn, filename);
     } else {
@@ -186,15 +191,20 @@
   Support very long input path name, longer than _MAX_PATH for
   Windows, if it really exists and input name is given in
   full-absolute path in a command line.
+  /./ , /../, \.\, \..\ should be excluded. (2020/06/06)
 */
     fnn = xmalloc(len + 10);
-    if (len > 2 && ((filename[0] == '/' && filename[1] == '/') ||
+    p = strstr(filename, ".\\");
+    if (!p) {
+       p = strstr(filename, "./");
+    }
+    if (!p && len > 2 && ((filename[0] == '/' && filename[1] == '/') ||
         (filename[0] == '\\' && filename[1] == '\\' &&
          filename[2] != '?'))) {
        filename += 2;
        strcpy (fnn, "\\\\?\\UNC\\");
        strcat (fnn, filename);
-    } else if (len > 2 && filename[1] == ':') {
+    } else if (!p && len > 2 && filename[1] == ':') {
        strcpy (fnn, "\\\\?\\");
        strcat (fnn, filename);
     } else {

Modified: trunk/Build/source/texk/kpathsea/readable.c
===================================================================
--- trunk/Build/source/texk/kpathsea/readable.c	2020-06-05 23:56:02 UTC (rev 55429)
+++ trunk/Build/source/texk/kpathsea/readable.c	2020-06-06 05:19:02 UTC (rev 55430)
@@ -50,13 +50,18 @@
   Support very long input path name, longer than _MAX_PATH for
   Windows, if it really exists and input name is given in
   full-absolute path in a command line.
+  /../, /./, \..\, \.\ should be excluded (2020/06/06)
 */
-  if (len > 2 && ((fn[0] == '/' && fn[1] == '/') ||
+  p = strstr(fn, ".\\");
+  if (!p) {
+    p = strstr(fn, "./");
+  }
+  if (!p && len > 2 && ((fn[0] == '/' && fn[1] == '/') ||
       (fn[0] == '\\' && fn[1] == '\\' && fn[2] != '?'))) {
     fn += 2;
     strcpy (fnn, "\\\\?\\UNC\\");
     strcat (fnn, fn);
-  } else if (len > 2 && fn[1] == ':') {
+  } else if (!p && len > 2 && fn[1] == ':') {
     strcpy (fnn, "\\\\?\\");
     strcat (fnn, fn);
   } else {



More information about the tex-live-commits mailing list.