mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8272746: ZipFile can't open big file (NegativeArraySizeException)
Reviewed-by: lancea
This commit is contained in:
parent
b734dc86ee
commit
848b16a3f9
2 changed files with 92 additions and 0 deletions
|
@ -1497,6 +1497,9 @@ public class ZipFile implements ZipConstants, Closeable {
|
|||
zerror("invalid END header (bad central directory offset)");
|
||||
}
|
||||
// read in the CEN and END
|
||||
if (end.cenlen + ENDHDR >= Integer.MAX_VALUE) {
|
||||
zerror("invalid END header (central directory size too large)");
|
||||
}
|
||||
cen = this.cen = new byte[(int)(end.cenlen + ENDHDR)];
|
||||
if (readFullyAt(cen, 0, cen.length, cenpos) != end.cenlen + ENDHDR) {
|
||||
zerror("read CEN tables failed");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue