pjfanning commented on code in PR #1128:
URL: https://github.com/apache/poi/pull/1128#discussion_r3390364783


##########
poi-ooxml/src/main/java/org/apache/poi/openxml4j/util/ZipInputStreamZipEntrySource.java:
##########
@@ -98,21 +97,33 @@ public static boolean shouldEncryptTempFiles() {
      */
     public ZipInputStreamZipEntrySource(ZipArchiveThresholdInputStream inp) 
throws IOException {
         final Set<String> filenames = new HashSet<>();
-        for (;;) {
-            final ZipArchiveEntry zipEntry = inp.getNextEntry();
-            if (zipEntry == null) {
-                break;
+        try {
+            for (;;) {
+                final ZipArchiveEntry zipEntry = inp.getNextEntry();
+                if (zipEntry == null) {
+                    break;
+                }
+                String name = zipEntry.getName();
+                if (name == null || name.isEmpty()) {
+                    throw new InvalidZipException("Input file contains an 
entry with an empty name");
+                }
+                name = name.replace('\\', '/').toLowerCase(Locale.ROOT);

Review Comment:
   use IOUtils.normalizePath



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to