Package: openjdk-11 / 11.0.28~3ea-1

icc_loading_with_symlink.diff Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
--- a/src/java.desktop/share/classes/java/awt/color/ICC_Profile.java
+++ b/src/java.desktop/share/classes/java/awt/color/ICC_Profile.java
@@ -1753,9 +1753,6 @@
                     dir = st.nextToken();
                         fullPath = dir + File.separatorChar + fileName;
                     f = new File(fullPath);
-                    if (!isChildOf(f, dir)) {
-                        f = null;
-                    }
                 }
             }
 
@@ -1795,26 +1792,6 @@
     }
 
     /**
-     * Checks whether given file resides inside give directory.
-     */
-    private static boolean isChildOf(File f, String dirName) {
-        try {
-            File dir = new File(dirName);
-            String canonicalDirName = dir.getCanonicalPath();
-            if (!canonicalDirName.endsWith(File.separator)) {
-                canonicalDirName += File.separator;
-            }
-            String canonicalFileName = f.getCanonicalPath();
-            return canonicalFileName.startsWith(canonicalDirName);
-        } catch (IOException e) {
-            /* we do not expect the IOException here, because invocation
-             * of this function is always preceded by isFile() call.
-             */
-            return false;
-        }
-    }
-
-    /**
      * Checks whether built-in profile specified by fileName exists.
      */
     private static boolean standardProfileExists(final String fileName) {