-
Notifications
You must be signed in to change notification settings - Fork 318
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
ArrayIndexOutofBoundsException when read directory from zipInputStream #33
Comments
directory.zip |
Can you please give me the password for the zip file and also the code you used? I have not been able to reproduce this issue with some sample zip files which have directories in it. For me ZipInputStream works fine. |
The password is password.
Did I use it in a wrong way? I also tried copying your code on the readme.md, didn't work either. |
Hi, Srikanth, I am using Ubuntu. Before I just right clicked on the folder and clicked "compress" using this GUI to compress the folder. But when I tried to create the zip file from command line like "zip -re filename.zip folderpath password", it wouldn't throw this ArrayIndexOutofBoundsException. That's weird. |
Apparently, Ubuntu is creating some corrupt extra data headers for some of the entries in the zip file. These headers are some additional information and the zip file can still be extracted without them. I have pushed a fix to ignore such headers. I will include this fix in the next release |
Thank you! |
Fixed in v2.1.2 |
Hi, Author. I found out this bug that when I tried to read encrypted zip files from ZipInputStream, if it meet some directories, it would throw this exception:
java.lang.ArrayIndexOutOfBoundsException: 11
at net.lingala.zip4j.util.RawIO.readShortLittleEndian(RawIO.java:109)
at net.lingala.zip4j.headers.HeaderReader.parseExtraDataRecords(HeaderReader.java:309)
at net.lingala.zip4j.headers.HeaderReader.readExtraDataRecords(HeaderReader.java:297)
at net.lingala.zip4j.headers.HeaderReader.readExtraDataRecords(HeaderReader.java:264)
at net.lingala.zip4j.headers.HeaderReader.readLocalFileHeader(HeaderReader.java:553)
at net.lingala.zip4j.io.inputstream.ZipInputStream.getNextEntry(ZipInputStream.java:66)
at net.lingala.zip4j.io.inputstream.ZipInputStream.getNextEntry(ZipInputStream.java:62)
This error only happens on reading directories from ZipInputStream.
Please help me fix this bug. I am in urgent need.
Thank you in advance!
The text was updated successfully, but these errors were encountered: