RFR: 8328874: Class::forName0 should validate the class name length early
David Holmes
dholmes at openjdk.org
Tue Aug 19 06:18:36 UTC 2025
On Fri, 15 Aug 2025 15:44:36 GMT, Chen Liang <liach at openjdk.org> wrote:
> We currently have a trend of moving argument validations and checks to pure Java code, to minimize downcall into the VM (whose code cannot be optimized by compilers). Even if we keep checks in the VM, I guess jvm.cpp might be a better place than Class.c.
No, that would defeat the purpose of creating this request in the first place. It was the calls within Class.c that originally choked on the excessive length. We want to avoid operating on these excessively large strings, and so need to bail out early on the Java/libjava side.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/26802#issuecomment-3199349458
More information about the core-libs-dev
mailing list