Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v15]

2024-02-13 Thread Eirik Bjørsnøs
On Fri, 26 Jan 2024 20:49:57 GMT, Lance Andersen wrote: >> To help make progress here, I have relaxed the validation such that we now >> check: >> >> - That the "streaming mode" bit 3 flag is set >> - That at least one of the LOC's size fields are marked 0x. >> - That the LOC extra fiel

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v16]

2024-02-12 Thread Lance Andersen
On Mon, 5 Feb 2024 13:14:39 GMT, Eirik Bjørsnøs wrote: >> ZipInputStream.readEnd currently assumes a Zip64 data descriptor if the >> number of compressed or uncompressed bytes read from the inflater is larger >> than the Zip64 magic value. >> >> While the ZIP format mandates that the data des

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v15]

2024-02-05 Thread Eirik Bjørsnøs
On Mon, 5 Feb 2024 12:31:37 GMT, Jaikiran Pai wrote: >> Eirik Bjørsnøs has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 228 commits: >> >> - Merge branch 'master' into data-descriptor >> - Update comment of expect64BitDataDescrip

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v16]

2024-02-05 Thread Jaikiran Pai
On Mon, 5 Feb 2024 13:14:39 GMT, Eirik Bjørsnøs wrote: >> ZipInputStream.readEnd currently assumes a Zip64 data descriptor if the >> number of compressed or uncompressed bytes read from the inflater is larger >> than the Zip64 magic value. >> >> While the ZIP format mandates that the data des

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v16]

2024-02-05 Thread Eirik Bjørsnøs
> ZipInputStream.readEnd currently assumes a Zip64 data descriptor if the > number of compressed or uncompressed bytes read from the inflater is larger > than the Zip64 magic value. > > While the ZIP format mandates that the data descriptor `SHOULD be stored in > ZIP64 format (as 8 byte values

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v15]

2024-02-05 Thread Jaikiran Pai
On Fri, 26 Jan 2024 14:32:58 GMT, Eirik Bjørsnøs wrote: >> ZipInputStream.readEnd currently assumes a Zip64 data descriptor if the >> number of compressed or uncompressed bytes read from the inflater is larger >> than the Zip64 magic value. >> >> While the ZIP format mandates that the data de

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v15]

2024-02-05 Thread Jaikiran Pai
On Fri, 26 Jan 2024 14:32:58 GMT, Eirik Bjørsnøs wrote: >> ZipInputStream.readEnd currently assumes a Zip64 data descriptor if the >> number of compressed or uncompressed bytes read from the inflater is larger >> than the Zip64 magic value. >> >> While the ZIP format mandates that the data de

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v15]

2024-01-26 Thread Lance Andersen
On Fri, 26 Jan 2024 14:34:39 GMT, Eirik Bjørsnøs wrote: > To help make progress here, I have relaxed the validation such that we now > check: > > * That the "streaming mode" bit 3 flag is set > * That at least one of the LOC's size fields are marked 0x. > * That the LOC extra field has

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v15]

2024-01-26 Thread Eirik Bjørsnøs
On Fri, 26 Jan 2024 14:32:58 GMT, Eirik Bjørsnøs wrote: >> ZipInputStream.readEnd currently assumes a Zip64 data descriptor if the >> number of compressed or uncompressed bytes read from the inflater is larger >> than the Zip64 magic value. >> >> While the ZIP format mandates that the data de

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v15]

2024-01-26 Thread Eirik Bjørsnøs
> ZipInputStream.readEnd currently assumes a Zip64 data descriptor if the > number of compressed or uncompressed bytes read from the inflater is larger > than the Zip64 magic value. > > While the ZIP format mandates that the data descriptor `SHOULD be stored in > ZIP64 format (as 8 byte values

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v12]

2024-01-22 Thread Lance Andersen
On Mon, 22 Jan 2024 14:34:25 GMT, Eirik Bjørsnøs wrote: > @LanceAndersen Do you have a cent or two to spare? Let me try and dig out from a couple of things and circle back to this again - PR Review Comment: https://git.openjdk.org/jdk/pull/12524#discussion_r1462519461

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v12]

2024-01-22 Thread Eirik Bjørsnøs
On Tue, 16 Jan 2024 14:55:39 GMT, Jaikiran Pai wrote: > I think the only role that a zip64 block should play when we are deciding how > to parse a data descriptor is whether or not the entry has zip64 extra field > set (the header id value of the extra field). Does that sound reasonable? Are y

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v12]

2024-01-16 Thread Jaikiran Pai
On Tue, 16 Jan 2024 14:41:06 GMT, Eirik Bjørsnøs wrote: > The spec isn't terribly helpful in spelling out what should happen in the > case where an entry combines the uses of data descriptors (mandating that > CRC, size and compressed size must be zero) with Zip64 (mandating that size > and co

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v14]

2024-01-16 Thread Eirik Bjørsnøs
> ZipInputStream.readEnd currently assumes a Zip64 data descriptor if the > number of compressed or uncompressed bytes read from the inflater is larger > than the Zip64 magic value. > > While the ZIP format mandates that the data descriptor `SHOULD be stored in > ZIP64 format (as 8 byte values

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v12]

2024-01-16 Thread Eirik Bjørsnøs
On Tue, 16 Jan 2024 13:54:06 GMT, Jaikiran Pai wrote: >> Eirik Bjørsnøs has updated the pull request incrementally with two >> additional commits since the last revision: >> >> - Remove trailing whitespace >> - Remove trailing whitespace > > src/java.base/share/classes/java/util/zip/ZipInputS

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v12]

2024-01-16 Thread Jaikiran Pai
On Tue, 16 Jan 2024 14:34:29 GMT, Eirik Bjørsnøs wrote: >(These reads are from a temp buffer, not the stream) Ah! you are right indeed. I didn't correctly read that part of that code. It's reading from a temp buffer which has been fully initialized with a LOC and these reads happens with speci

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v13]

2024-01-16 Thread Jaikiran Pai
On Tue, 16 Jan 2024 14:32:51 GMT, Eirik Bjørsnøs wrote: >> ZipInputStream.readEnd currently assumes a Zip64 data descriptor if the >> number of compressed or uncompressed bytes read from the inflater is larger >> than the Zip64 magic value. >> >> While the ZIP format mandates that the data de

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v12]

2024-01-16 Thread Eirik Bjørsnøs
On Tue, 16 Jan 2024 13:42:30 GMT, Jaikiran Pai wrote: >> src/java.base/share/classes/java/util/zip/ZipInputStream.java line 534: >> >>> 532: >>> 533: long csize = get32(tmpbuf, LOCSIZ); >>> 534: long size = get32(tmpbuf, LOCLEN); >> >> Hello Eirik, I suspect this part of the ch

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v13]

2024-01-16 Thread Eirik Bjørsnøs
> ZipInputStream.readEnd currently assumes a Zip64 data descriptor if the > number of compressed or uncompressed bytes read from the inflater is larger > than the Zip64 magic value. > > While the ZIP format mandates that the data descriptor `SHOULD be stored in > ZIP64 format (as 8 byte values

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v12]

2024-01-16 Thread Jaikiran Pai
On Wed, 10 Jan 2024 13:39:52 GMT, Eirik Bjørsnøs wrote: >> ZipInputStream.readEnd currently assumes a Zip64 data descriptor if the >> number of compressed or uncompressed bytes read from the inflater is larger >> than the Zip64 magic value. >> >> While the ZIP format mandates that the data de

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v12]

2024-01-16 Thread Jaikiran Pai
On Wed, 10 Jan 2024 13:39:52 GMT, Eirik Bjørsnøs wrote: >> ZipInputStream.readEnd currently assumes a Zip64 data descriptor if the >> number of compressed or uncompressed bytes read from the inflater is larger >> than the Zip64 magic value. >> >> While the ZIP format mandates that the data de

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v12]

2024-01-16 Thread Jaikiran Pai
On Wed, 10 Jan 2024 13:39:52 GMT, Eirik Bjørsnøs wrote: >> ZipInputStream.readEnd currently assumes a Zip64 data descriptor if the >> number of compressed or uncompressed bytes read from the inflater is larger >> than the Zip64 magic value. >> >> While the ZIP format mandates that the data de

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v12]

2024-01-16 Thread Jaikiran Pai
On Tue, 16 Jan 2024 13:40:18 GMT, Jaikiran Pai wrote: >> Eirik Bjørsnøs has updated the pull request incrementally with two >> additional commits since the last revision: >> >> - Remove trailing whitespace >> - Remove trailing whitespace > > src/java.base/share/classes/java/util/zip/ZipInputS

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v12]

2024-01-15 Thread Andrey Turbanov
On Wed, 10 Jan 2024 13:39:52 GMT, Eirik Bjørsnøs wrote: >> ZipInputStream.readEnd currently assumes a Zip64 data descriptor if the >> number of compressed or uncompressed bytes read from the inflater is larger >> than the Zip64 magic value. >> >> While the ZIP format mandates that the data de

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v12]

2024-01-15 Thread Alan Bateman
On Wed, 10 Jan 2024 13:39:52 GMT, Eirik Bjørsnøs wrote: >> ZipInputStream.readEnd currently assumes a Zip64 data descriptor if the >> number of compressed or uncompressed bytes read from the inflater is larger >> than the Zip64 magic value. >> >> While the ZIP format mandates that the data de

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v9]

2024-01-11 Thread Eirik Bjørsnøs
On Wed, 10 Jan 2024 17:02:05 GMT, Eirik Bjørsnøs wrote: >> Sounds like a CSR is needed for the behavioral change proposed here. > >> Sounds like a CSR is needed for the behavioral change proposed here. > > Thanks for flagging this @jddarcy > > I'm personally not 100% convinced a CSR is warrant

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v9]

2024-01-10 Thread Joe Darcy
On Wed, 10 Jan 2024 17:02:05 GMT, Eirik Bjørsnøs wrote: > > Sounds like a CSR is needed for the behavioral change proposed here. > > Thanks for flagging this @jddarcy > > I'm personally not 100% convinced a CSR is warranted in this case, but I'm of > course happy to extend the following into a

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v9]

2024-01-10 Thread Eirik Bjørsnøs
On Mon, 8 Jan 2024 18:21:06 GMT, Joe Darcy wrote: > Sounds like a CSR is needed for the behavioral change proposed here. Thanks for flagging this @jddarcy I'm personally not 100% convinced a CSR is warranted in this case, but I'm of course happy to extend the following into a CSR if you or ot

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v12]

2024-01-10 Thread Eirik Bjørsnøs
> ZipInputStream.readEnd currently assumes a Zip64 data descriptor if the > number of compressed or uncompressed bytes read from the inflater is larger > than the Zip64 magic value. > > While the ZIP format mandates that the data descriptor `SHOULD be stored in > ZIP64 format (as 8 byte values

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v11]

2024-01-10 Thread Eirik Bjørsnøs
> ZipInputStream.readEnd currently assumes a Zip64 data descriptor if the > number of compressed or uncompressed bytes read from the inflater is larger > than the Zip64 magic value. > > While the ZIP format mandates that the data descriptor `SHOULD be stored in > ZIP64 format (as 8 byte values

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v10]

2024-01-10 Thread Eirik Bjørsnøs
On Tue, 9 Jan 2024 13:06:56 GMT, Eirik Bjørsnøs wrote: >> ZipInputStream.readEnd currently assumes a Zip64 data descriptor if the >> number of compressed or uncompressed bytes read from the inflater is larger >> than the Zip64 magic value. >> >> While the ZIP format mandates that the data des

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v10]

2024-01-09 Thread Eirik Bjørsnøs
On Tue, 9 Jan 2024 13:06:56 GMT, Eirik Bjørsnøs wrote: >> ZipInputStream.readEnd currently assumes a Zip64 data descriptor if the >> number of compressed or uncompressed bytes read from the inflater is larger >> than the Zip64 magic value. >> >> While the ZIP format mandates that the data des

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v9]

2024-01-09 Thread Eirik Bjørsnøs
On Mon, 8 Jan 2024 15:43:34 GMT, Jaikiran Pai wrote: > The crucial part here is that the "current" `ZipEntry` is the one which was > created by a previous call to `ZipInputStream.getNextEntry()` method, which > is a public overridable method. Furthermore, the `ZipEntry.getExtra()` method > too

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v9]

2024-01-09 Thread Eirik Bjørsnøs
On Mon, 8 Jan 2024 15:04:58 GMT, Jaikiran Pai wrote: >> Eirik Bjørsnøs has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 33 commits: >> >> - Merge branch 'master' into data-descriptor >> - Extract ZIP64_BLOCK_SIZE_OFFSET as a cons

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v9]

2024-01-09 Thread Eirik Bjørsnøs
On Mon, 8 Jan 2024 14:59:40 GMT, Jaikiran Pai wrote: >> Eirik Bjørsnøs has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 33 commits: >> >> - Merge branch 'master' into data-descriptor >> - Extract ZIP64_BLOCK_SIZE_OFFSET as a cons

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v10]

2024-01-09 Thread Eirik Bjørsnøs
> ZipInputStream.readEnd currently assumes a Zip64 data descriptor if the > number of compressed or uncompressed bytes read from the inflater is larger > than the Zip64 magic value. > > While the ZIP format mandates that the data descriptor `SHOULD be stored in > ZIP64 format (as 8 byte values

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v9]

2024-01-08 Thread Joe Darcy
On Fri, 22 Dec 2023 07:55:24 GMT, Eirik Bjørsnøs wrote: >> ZipInputStream.readEnd currently assumes a Zip64 data descriptor if the >> number of compressed or uncompressed bytes read from the inflater is larger >> than the Zip64 magic value. >> >> While the ZIP format mandates that the data de

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v9]

2024-01-08 Thread Jaikiran Pai
On Mon, 8 Jan 2024 14:47:48 GMT, Jaikiran Pai wrote: > With the current proposed change, we not only rely on the Inflater for this > decision but also rely on ZipEntry itself to tell us whether to read 8 bytes > or 4 bytes each. The proposed change resides solely in one single internal/privat

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v9]

2024-01-08 Thread Jaikiran Pai
On Fri, 22 Dec 2023 07:55:24 GMT, Eirik Bjørsnøs wrote: >> ZipInputStream.readEnd currently assumes a Zip64 data descriptor if the >> number of compressed or uncompressed bytes read from the inflater is larger >> than the Zip64 magic value. >> >> While the ZIP format mandates that the data de

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v9]

2024-01-08 Thread Jaikiran Pai
On Fri, 22 Dec 2023 07:55:24 GMT, Eirik Bjørsnøs wrote: >> ZipInputStream.readEnd currently assumes a Zip64 data descriptor if the >> number of compressed or uncompressed bytes read from the inflater is larger >> than the Zip64 magic value. >> >> While the ZIP format mandates that the data de

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v9]

2024-01-08 Thread Jaikiran Pai
On Fri, 22 Dec 2023 07:55:24 GMT, Eirik Bjørsnøs wrote: >> ZipInputStream.readEnd currently assumes a Zip64 data descriptor if the >> number of compressed or uncompressed bytes read from the inflater is larger >> than the Zip64 magic value. >> >> While the ZIP format mandates that the data de

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v9]

2024-01-08 Thread Jaikiran Pai
On Fri, 22 Dec 2023 07:55:24 GMT, Eirik Bjørsnøs wrote: >> ZipInputStream.readEnd currently assumes a Zip64 data descriptor if the >> number of compressed or uncompressed bytes read from the inflater is larger >> than the Zip64 magic value. >> >> While the ZIP format mandates that the data de

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v9]

2024-01-08 Thread Jaikiran Pai
On Fri, 22 Dec 2023 07:55:24 GMT, Eirik Bjørsnøs wrote: >> ZipInputStream.readEnd currently assumes a Zip64 data descriptor if the >> number of compressed or uncompressed bytes read from the inflater is larger >> than the Zip64 magic value. >> >> While the ZIP format mandates that the data de

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v9]

2023-12-21 Thread Eirik Bjorsnos
> ZipInputStream.readEnd currently assumes a Zip64 data descriptor if the > number of compressed or uncompressed bytes read from the inflater is larger > than the Zip64 magic value. > > While the ZIP format mandates that the data descriptor `SHOULD be stored in > ZIP64 format (as 8 byte values

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files

2023-12-21 Thread Eirik Bjorsnos
On Sun, 12 Feb 2023 17:04:51 GMT, Alan Bateman wrote: >> ZipInputStream.readEnd currently assumes a Zip64 data descriptor if the >> number of compressed or uncompressed bytes read from the inflater is larger >> than the Zip64 magic value. >> >> While the ZIP format mandates that the data desc

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v8]

2023-12-21 Thread Jaikiran Pai
On Tue, 28 Nov 2023 18:38:42 GMT, Eirik Bjorsnos wrote: >> Eirik Bjorsnos has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Extract ZIP64_BLOCK_SIZE_OFFSET as a constant > > Thanks for your patient and thorough review of this long-lived PR

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v8]

2023-12-01 Thread Eirik Bjorsnos
On Wed, 15 Nov 2023 20:10:53 GMT, Eirik Bjorsnos wrote: >> ZipInputStream.readEnd currently assumes a Zip64 data descriptor if the >> number of compressed or uncompressed bytes read from the inflater is larger >> than the Zip64 magic value. >> >> While the ZIP format mandates that the data de

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v8]

2023-11-28 Thread Lance Andersen
On Wed, 15 Nov 2023 20:10:53 GMT, Eirik Bjorsnos wrote: >> ZipInputStream.readEnd currently assumes a Zip64 data descriptor if the >> number of compressed or uncompressed bytes read from the inflater is larger >> than the Zip64 magic value. >> >> While the ZIP format mandates that the data de

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v6]

2023-11-15 Thread Lance Andersen
On Wed, 15 Nov 2023 20:13:15 GMT, Eirik Bjorsnos wrote: >> src/java.base/share/classes/java/util/zip/ZipInputStream.java line 581: >> >>> 579: if ((flag & 8) == 8) { >>> 580: /* "Data Descriptor" present */ >>> 581: if (hasZip64Extra(e) || >> >> You probably want

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v6]

2023-11-15 Thread Eirik Bjorsnos
On Tue, 14 Nov 2023 11:49:11 GMT, Lance Andersen wrote: >> Eirik Bjorsnos has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Add a @bug reference in the test > > src/java.base/share/classes/java/util/zip/ZipInputStream.java line 581: > >>

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v6]

2023-11-15 Thread Eirik Bjorsnos
On Mon, 13 Nov 2023 19:02:28 GMT, Lance Andersen wrote: >> Eirik Bjorsnos has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Add a @bug reference in the test > > test/jdk/java/util/zip/ZipInputStream/Zip64DataDescriptor.java line 57: > >>

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v8]

2023-11-15 Thread Eirik Bjorsnos
> ZipInputStream.readEnd currently assumes a Zip64 data descriptor if the > number of compressed or uncompressed bytes read from the inflater is larger > than the Zip64 magic value. > > While the ZIP format mandates that the data descriptor `SHOULD be stored in > ZIP64 format (as 8 byte values

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v7]

2023-11-15 Thread Eirik Bjorsnos
> ZipInputStream.readEnd currently assumes a Zip64 data descriptor if the > number of compressed or uncompressed bytes read from the inflater is larger > than the Zip64 magic value. > > While the ZIP format mandates that the data descriptor `SHOULD be stored in > ZIP64 format (as 8 byte values

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v6]

2023-11-14 Thread Lance Andersen
On Wed, 8 Nov 2023 13:45:14 GMT, Eirik Bjorsnos wrote: >> ZipInputStream.readEnd currently assumes a Zip64 data descriptor if the >> number of compressed or uncompressed bytes read from the inflater is larger >> than the Zip64 magic value. >> >> While the ZIP format mandates that the data des

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v6]

2023-11-08 Thread Eirik Bjorsnos
> ZipInputStream.readEnd currently assumes a Zip64 data descriptor if the > number of compressed or uncompressed bytes read from the inflater is larger > than the Zip64 magic value. > > While the ZIP format mandates that the data descriptor `SHOULD be stored in > ZIP64 format (as 8 byte values

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v5]

2023-11-08 Thread Eirik Bjorsnos
> ZipInputStream.readEnd currently assumes a Zip64 data descriptor if the > number of compressed or uncompressed bytes read from the inflater is larger > than the Zip64 magic value. > > While the ZIP format mandates that the data descriptor `SHOULD be stored in > ZIP64 format (as 8 byte values

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v4]

2023-11-08 Thread Eirik Bjorsnos
On Wed, 8 Nov 2023 13:20:33 GMT, Eirik Bjorsnos wrote: >> ZipInputStream.readEnd currently assumes a Zip64 data descriptor if the >> number of compressed or uncompressed bytes read from the inflater is larger >> than the Zip64 magic value. >> >> While the ZIP format mandates that the data des

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v3]

2023-11-08 Thread Eirik Bjorsnos
On Sat, 28 Oct 2023 17:34:35 GMT, Eirik Bjorsnos wrote: > We need to hold off this PR until #15650 has been integrated as it impacts > some of the changes proposed here Marking this PR ready for review, now that #15650 has been integrated. A summary of updates after #15650: - `ZipFile.isZip64

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v4]

2023-11-08 Thread Eirik Bjorsnos
> ZipInputStream.readEnd currently assumes a Zip64 data descriptor if the > number of compressed or uncompressed bytes read from the inflater is larger > than the Zip64 magic value. > > While the ZIP format mandates that the data descriptor `SHOULD be stored in > ZIP64 format (as 8 byte values

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v3]

2023-10-28 Thread Eirik Bjorsnos
On Sat, 28 Oct 2023 17:08:07 GMT, Eirik Bjorsnos wrote: >> ZipInputStream.readEnd currently assumes a Zip64 data descriptor if the >> number of compressed or uncompressed bytes read from the inflater is larger >> than the Zip64 magic value. >> >> While the ZIP format mandates that the data de

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v3]

2023-10-28 Thread Lance Andersen
On Sat, 28 Oct 2023 17:08:07 GMT, Eirik Bjorsnos wrote: >> ZipInputStream.readEnd currently assumes a Zip64 data descriptor if the >> number of compressed or uncompressed bytes read from the inflater is larger >> than the Zip64 magic value. >> >> While the ZIP format mandates that the data de

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v3]

2023-10-28 Thread Eirik Bjorsnos
On Sat, 28 Oct 2023 17:08:07 GMT, Eirik Bjorsnos wrote: >> ZipInputStream.readEnd currently assumes a Zip64 data descriptor if the >> number of compressed or uncompressed bytes read from the inflater is larger >> than the Zip64 magic value. >> >> While the ZIP format mandates that the data de

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v3]

2023-10-28 Thread Eirik Bjorsnos
> ZipInputStream.readEnd currently assumes a Zip64 data descriptor if the > number of compressed or uncompressed bytes read from the inflater is larger > than the Zip64 magic value. > > While the ZIP format mandates that the data descriptor `SHOULD be stored in > ZIP64 format (as 8 byte values

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v2]

2023-04-18 Thread Eirik Bjorsnos
On Tue, 18 Apr 2023 18:19:20 GMT, Lance Andersen wrote: > It would be useful to obtain the zip/jar in question to validate that your > proposed patch addresses the issue as well as verifying if ZipfFile can be > used to process the zip/jar as reading the long thread appears that > ZipFile:getI

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v2]

2023-04-18 Thread Lance Andersen
On Tue, 18 Apr 2023 18:24:01 GMT, Eirik Bjorsnos wrote: > > Do you know how the Zip in question is being created, is it via > > ApacheCommons and could there be an issue there? > > Currently investigating. The Tomcat build is using the Ant `jar` task to > create the `tomcat-embed-core.jar`, bu

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v2]

2023-04-18 Thread Eirik Bjorsnos
On Tue, 18 Apr 2023 18:19:20 GMT, Lance Andersen wrote: > Do you know how the Zip in question is being created, is it via ApacheCommons > and could there be an issue there? Currently investigating. The Tomcat build is using the Ant `jar` task to create the `tomcat-embed-core.jar`, but then cal

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v2]

2023-04-18 Thread Lance Andersen
On Wed, 29 Mar 2023 10:48:57 GMT, Eirik Bjorsnos wrote: >> ZipInputStream.readEnd currently assumes a Zip64 data descriptor if the >> number of compressed or uncompressed bytes read from the inflater is larger >> than the Zip64 magic value. >> >> While the ZIP format mandates that the data de

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v2]

2023-04-18 Thread Eirik Bjorsnos
On Wed, 29 Mar 2023 10:48:57 GMT, Eirik Bjorsnos wrote: >> ZipInputStream.readEnd currently assumes a Zip64 data descriptor if the >> number of compressed or uncompressed bytes read from the inflater is larger >> than the Zip64 magic value. >> >> While the ZIP format mandates that the data de

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files [v2]

2023-03-29 Thread Eirik Bjorsnos
> ZipInputStream.readEnd currently assumes a Zip64 data descriptor if the > number of compressed or uncompressed bytes read from the inflater is larger > than the Zip64 magic value. > > While the ZIP format mandates that the data descriptor `SHOULD be stored in > ZIP64 format (as 8 byte values

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files

2023-03-29 Thread Alan Bateman
On Sun, 12 Feb 2023 15:41:55 GMT, Eirik Bjorsnos wrote: > ZipInputStream.readEnd currently assumes a Zip64 data descriptor if the > number of compressed or uncompressed bytes read from the inflater is larger > than the Zip64 magic value. > > While the ZIP format mandates that the data descrip

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files

2023-03-29 Thread Lance Andersen
On Sun, 12 Feb 2023 15:41:55 GMT, Eirik Bjorsnos wrote: > ZipInputStream.readEnd currently assumes a Zip64 data descriptor if the > number of compressed or uncompressed bytes read from the inflater is larger > than the Zip64 magic value. > > While the ZIP format mandates that the data descrip

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files

2023-03-29 Thread Eirik Bjorsnos
On Sun, 12 Feb 2023 17:04:51 GMT, Alan Bateman wrote: > The current implementation came about because of issues with several zip > tools so we have to be very careful changing it. Thanks for providing historical context, that's very useful! Do you happen to know a few of the zip tools the cur

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files

2023-03-29 Thread Eirik Bjorsnos
On Mon, 20 Feb 2023 11:28:29 GMT, Lance Andersen wrote: >> ZipInputStream.readEnd currently assumes a Zip64 data descriptor if the >> number of compressed or uncompressed bytes read from the inflater is larger >> than the Zip64 magic value. >> >> While the ZIP format mandates that the data de

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files

2023-03-29 Thread Eirik Bjorsnos
On Tue, 28 Feb 2023 20:31:43 GMT, Eirik Bjorsnos wrote: > Thanks a lot for looking into this, Lance! > > > Are you aware of any tools that would create this scenario as to the best > > of my knowledge we have not encountered one that does as of yet? > > The following on my Mac produces a Zip64

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files

2023-03-29 Thread Eirik Bjorsnos
On Sun, 12 Feb 2023 15:41:55 GMT, Eirik Bjorsnos wrote: > ZipInputStream.readEnd currently assumes a Zip64 data descriptor if the > number of compressed or uncompressed bytes read from the inflater is larger > than the Zip64 magic value. > > While the ZIP format mandates that the data descrip

Re: RFR: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files

2023-03-29 Thread Eirik Bjorsnos
On Tue, 28 Feb 2023 20:48:47 GMT, Eirik Bjorsnos wrote: > > Thanks a lot for looking into this, Lance! > > > Are you aware of any tools that would create this scenario as to the best > > > of my knowledge we have not encountered one that does as of yet? > > > > > > The following on my Mac prod