You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by pe...@apache.org on 2020/08/17 09:18:34 UTC

[commons-compress] branch master updated: fix for signature detect

This is an automated email from the ASF dual-hosted git repository.

peterlee pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-compress.git


The following commit(s) were added to refs/heads/master by this push:
     new 86bb35a  fix for signature detect
86bb35a is described below

commit 86bb35aa4e92da6c3c9e78551dffc3fb0193caab
Author: PeterAlfredLee <pe...@gmail.com>
AuthorDate: Mon Aug 17 17:14:17 2020 +0800

    fix for signature detect
    
    fix for problems in signature detecting of Central Directory File Signature
---
 .../apache/commons/compress/archivers/zip/ZipArchiveInputStream.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java b/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java
index 66fd17b..32bb562 100644
--- a/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java
+++ b/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java
@@ -990,7 +990,7 @@ public class ZipArchiveInputStream extends ArchiveInputStream implements InputSt
                 int expectDDPos = i;
                 if (i >= expectedDDLen &&
                     (buf.array()[i + 2] == LFH[2] && buf.array()[i + 3] == LFH[3])
-                    || (buf.array()[i] == CFH[2] && buf.array()[i + 3] == CFH[3])) {
+                    || (buf.array()[i + 2] == CFH[2] && buf.array()[i + 3] == CFH[3])) {
                     // found a LFH or CFH:
                     expectDDPos = i - expectedDDLen;
                     done = true;