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


##########
poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/temp/AesZipFileZipEntrySource.java:
##########
@@ -130,12 +131,13 @@ private static void copyToFile(InputStream is, File 
tmpFile, byte[] keyBytes, by
         SecretKeySpec skeySpec = new SecretKeySpec(keyBytes, 
CipherAlgorithm.aes128.jceId);
         Cipher ciEnc = CryptoFunctions.getCipher(skeySpec, 
CipherAlgorithm.aes128, ChainingMode.cbc, ivBytes, Cipher.ENCRYPT_MODE, 
PADDING);
 
-        try (ZipArchiveInputStream zis = new ZipArchiveInputStream(is);
+        try (ZipArchiveInputStream zipStream = new ZipArchiveInputStream(is);
+             ZipArchiveThresholdInputStream zis = new 
ZipArchiveThresholdInputStream(zipStream);
              OutputStream fos = Files.newOutputStream(tmpFile.toPath());
              ZipArchiveOutputStream zos = new ZipArchiveOutputStream(fos)) {
 
             ZipArchiveEntry ze;
-            while ((ze = zis.getNextEntry()) != null) {
+            while ((ze = zipStream.getNextEntry()) != null) {

Review Comment:
   this doesn't seem right - shouldn't you call zis.getNextEntry? otherwise, 
what is the point of creating a ZipArchiveThresholdInputStream? 



-- 
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