Re: RFR: 8320360: ClassFile.parse: Some defect class files cause unexpected exceptions to be thrown [v2]

2024-01-02 Thread Adam Sotona
On Thu, 7 Dec 2023 07:53:58 GMT, Adam Sotona wrote: >> ClassFile API throws `IndexOutOfBoundsException` when classfile structure is >> corrupted so the parser attempts to read beyond the classfile bounds. >> General contract is that only `IllegalArgumentException` or its subclasses >> is

Re: RFR: 8320360: ClassFile.parse: Some defect class files cause unexpected exceptions to be thrown [v2]

2024-01-02 Thread Adam Sotona
On Tue, 2 Jan 2024 07:03:55 GMT, Jaikiran Pai wrote: >> Adam Sotona has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains three commits: >> >> - Merge branch 'master' into JDK-8320360-bounds >> >># Conflicts: >>#

Re: RFR: 8320360: ClassFile.parse: Some defect class files cause unexpected exceptions to be thrown [v2]

2024-01-02 Thread Adam Sotona
On Tue, 2 Jan 2024 12:41:08 GMT, Adam Sotona wrote: >> src/java.base/share/classes/jdk/internal/classfile/impl/ClassReaderImpl.java >> line 283: >> >>> 281: public void copyBytesTo(BufWriter buf, int p, int len) { >>> 282: try { >>> 283: buf.writeBytes(buffer, p, len);

Re: RFR: 8320360: ClassFile.parse: Some defect class files cause unexpected exceptions to be thrown [v2]

2024-01-02 Thread Adam Sotona
On Tue, 2 Jan 2024 07:05:22 GMT, Jaikiran Pai wrote: >> Adam Sotona has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains three commits: >> >> - Merge branch 'master' into JDK-8320360-bounds >> >># Conflicts: >>#

Re: RFR: 8320360: ClassFile.parse: Some defect class files cause unexpected exceptions to be thrown [v2]

2024-01-01 Thread Jaikiran Pai
On Thu, 7 Dec 2023 07:53:58 GMT, Adam Sotona wrote: >> ClassFile API throws `IndexOutOfBoundsException` when classfile structure is >> corrupted so the parser attempts to read beyond the classfile bounds. >> General contract is that only `IllegalArgumentException` or its subclasses >> is

Re: RFR: 8320360: ClassFile.parse: Some defect class files cause unexpected exceptions to be thrown [v2]

2023-12-13 Thread Adam Sotona
On Thu, 7 Dec 2023 07:53:58 GMT, Adam Sotona wrote: >> ClassFile API throws `IndexOutOfBoundsException` when classfile structure is >> corrupted so the parser attempts to read beyond the classfile bounds. >> General contract is that only `IllegalArgumentException` or its subclasses >> is

Re: RFR: 8320360: ClassFile.parse: Some defect class files cause unexpected exceptions to be thrown [v2]

2023-12-06 Thread Adam Sotona
> ClassFile API throws `IndexOutOfBoundsException` when classfile structure is > corrupted so the parser attempts to read beyond the classfile bounds. > General contract is that only `IllegalArgumentException` or its subclasses is > expected when parser fails. > This patch wraps