8226530: ZipFile reads wrong entry size from ZIP64 entries

Reviewed-by: bpb, clanger, shade
This commit is contained in:
Lance Andersen 2019-08-07 14:04:10 -04:00
parent 2b164a34ad
commit 5233e25c4c
4 changed files with 180 additions and 16 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -673,7 +673,7 @@ class ZipFile implements ZipConstants, Closeable {
e.method = CENHOW(cen, pos);
if (elen != 0) {
int start = pos + CENHDR + nlen;
e.setExtra0(Arrays.copyOfRange(cen, start, start + elen), true);
e.setExtra0(Arrays.copyOfRange(cen, start, start + elen), true, false);
}
if (clen != 0) {
int start = pos + CENHDR + nlen + elen;