On Tue, 21 Nov 2023 13:59:23 GMT, Adam Sotona <[email protected]> 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
> expected when parser fails.
> This patch wraps `IndexOutOfBoundsExceptions` thrown from all
> `ClassReaderImpl.buffer` manipulations into an
> `IllegalArgumentException("Reading beyond classfile bounds", iOOBECause)`.
> Relevant tests are added.
>
> Please review.
>
> Thanks,
> Adam
This pull request has now been integrated.
Changeset: a5cf4210
Author: Adam Sotona <[email protected]>
URL:
https://git.openjdk.org/jdk/commit/a5cf4210cd9c293a9e9bce60dc6d0f08fd838c77
Stats: 71 lines in 2 files changed: 47 ins; 0 del; 24 mod
8320360: ClassFile.parse: Some defect class files cause unexpected exceptions
to be thrown
Reviewed-by: jpai
-------------
PR: https://git.openjdk.org/jdk/pull/16762