tballison commented on code in PR #386:
URL: https://github.com/apache/commons-compress/pull/386#discussion_r1194351373


##########
src/main/java/org/apache/commons/compress/archivers/ArchiveStreamFactory.java:
##########
@@ -268,7 +269,16 @@ public static String detect(final InputStream in) throws 
ArchiveException {
             try {
                 tais = new TarArchiveInputStream(new 
ByteArrayInputStream(tarHeader));
                 // COMPRESS-191 - verify the header checksum
-                if (tais.getNextTarEntry().isCheckSumOK()) {
+                // COMPRESS-644 - do not allow zero byte file entries
+                TarArchiveEntry tae = tais.getNextTarEntry();
+                //try to find the first non-directory entry within the first 
10 entries.
+                int max = 10;

Review Comment:
   Completely arbitrary.  I improved documentation.  I'm completely open to the 
idea of dropping this attempt to iterate through the first x directory entries. 



-- 
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: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to