8145343: CorruptEntry.java fails after push for JDK-8145260
authorsherman
Tue, 15 Dec 2015 08:54:35 -0800
changeset 34693 5b58b6cdc196
parent 34692 cfb24ebd8fb2
child 34694 8566f3f715b0
child 34702 92e32436d471
8145343: CorruptEntry.java fails after push for JDK-8145260 Reviewed-by: weijun
jdk/src/java.base/share/classes/java/util/zip/ZipFile.java
--- a/jdk/src/java.base/share/classes/java/util/zip/ZipFile.java	Fri Dec 11 16:35:59 2015 +0300
+++ b/jdk/src/java.base/share/classes/java/util/zip/ZipFile.java	Tue Dec 15 08:54:35 2015 -0800
@@ -833,7 +833,8 @@
             byte[] cen = zsrc.cen;
             for (int i = 0; i < names.length; i++) {
                 int pos = zsrc.metanames.get(i);
-                names[i] = zc.toStringUTF8(cen, pos + CENHDR,  CENNAM(cen, pos));
+                names[i] = new String(cen, pos + CENHDR,  CENNAM(cen, pos),
+                                      StandardCharsets.UTF_8);
             }
             return names;
         }