Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.util.zip.ZipException: invalid entry size (expected 0 but got 622 bytes) #64

Open
Andreas-Schniertshauer opened this issue Dec 21, 2021 · 4 comments

Comments

@Andreas-Schniertshauer
Copy link

I get various messages java.util.zip.ZipException: invalid entry size (expected 0 but got 622 bytes) when e.g. scanning the following zip file: https://github.com/microsoft/Windows-classic-samples/blob/main/Samples/Win7Samples/dataaccess/OPC/musicbundlesignature/SampleMusicBundle.zip

With 7-Zip I can open it.

@Andreas-Schniertshauer
Copy link
Author

And problem message unzip610c22.zip!/unzip610c22/testmake_ppmd.zip - java.util.zip.ZipException: invalid compression method e.g. http://antinode.info/ftp/info-zip/unzip610c22.zip
: invalid compression method
java.util.zip.ZipException: invalid compression method
at java.base/java.util.zip.ZipInputStream.read(ZipInputStream.java:226)
at java.base/java.util.zip.ZipInputStream.closeEntry(ZipInputStream.java:141)
at java.base/java.util.zip.ZipInputStream.getNextEntry(ZipInputStream.java:119)
at com.mergebase.log4j.Log4JDetector.findLog4jRecursive(Log4JDetector.java:283)
at com.mergebase.log4j.Log4JDetector.findLog4jRecursive(Log4JDetector.java:362)
at com.mergebase.log4j.Log4JDetector.scan(Log4JDetector.java:590)
at com.mergebase.log4j.Log4JDetector.analyze(Log4JDetector.java:697)
at com.mergebase.log4j.Log4JDetector.main(Log4JDetector.java:155)

@juliusmusseau
Copy link
Contributor

What does "java -version" print out?

@Andreas-Schniertshauer
Copy link
Author

openjdk 11.0.13 2021-10-19
OpenJDK Runtime Environment Temurin-11.0.13+8 (build 11.0.13+8)
OpenJDK 64-Bit Server VM Temurin-11.0.13+8 (build 11.0.13+8, mixed mode)

@rgmz
Copy link

rgmz commented Dec 22, 2021

Reproducible on:

java -version
openjdk version "11.0.13" 2021-10-19
OpenJDK Runtime Environment 18.9 (build 11.0.13+8)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.13+8, mixed mode, sharing)

Stack trace from 2021-12-22:

$ java -jar log4j-detector-2021.12.22.jar --verbose SampleMusicBundle.zip 
-- github.com/mergebase/log4j-detector v2021.12.22 (by mergebase.com) analyzing paths (could take a while).
-- Note: specify the '--verbose' flag to have every file examined printed to STDERR.
-- Examining /tmp/SampleMusicBundle.zip... 
-- Problem /tmp/SampleMusicBundle.zip - java.util.zip.ZipException: invalid entry size (expected 0 but got 622 bytes)
java.util.zip.ZipException: invalid entry size (expected 0 but got 622 bytes)
	at java.base/java.util.zip.ZipInputStream.readEnd(ZipInputStream.java:400)
	at java.base/java.util.zip.ZipInputStream.read(ZipInputStream.java:199)
	at java.base/java.util.zip.ZipInputStream.closeEntry(ZipInputStream.java:143)
	at java.base/java.util.zip.ZipInputStream.getNextEntry(ZipInputStream.java:121)
	at com.mergebase.log4j.Log4JDetector.findLog4jRecursive(Log4JDetector.java:291)
	at com.mergebase.log4j.Log4JDetector.scan(Log4JDetector.java:617)
	at com.mergebase.log4j.Log4JDetector.analyze(Log4JDetector.java:724)
	at com.mergebase.log4j.Log4JDetector.main(Log4JDetector.java:160)

There's a StackOverfow question with this exact error and no answers; it could be related to a specific Zip format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants