mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8331940: ClassFile API ArrayIndexOutOfBoundsException with certain class files
Reviewed-by: liach, psandoz
This commit is contained in:
parent
61aff6db15
commit
42ccb74399
2 changed files with 20 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2022, 2024, 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
|
||||
|
@ -237,6 +237,10 @@ public final class CodeImpl
|
|||
int pEnd = p + (nLn * 4);
|
||||
for (; p < pEnd; p += 4) {
|
||||
int startPc = classReader.readU2(p);
|
||||
if (startPc > codeLength) {
|
||||
throw new IllegalArgumentException(String.format(
|
||||
"Line number start_pc out of range; start_pc=%d, codeLength=%d", startPc, codeLength));
|
||||
}
|
||||
int lineNumber = classReader.readU2(p + 2);
|
||||
lineNumbers[startPc] = lineNumber;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue