RFR: 8328874: Class::forName0 should validate the class name length early

Guanqiang Han ghan at openjdk.org
Fri Aug 15 15:27:54 UTC 2025


Validate class name length immediately after GetStringUTFLength() in Class.forName0. This prevents potential issues caused by overly long class names before they reach later code that would reject them, throwing ClassNotFoundException early.

-------------

Commit messages:
 - 8328874: Class::forName0 should validate the class name length early

Changes: https://git.openjdk.org/jdk/pull/26802/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=26802&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8328874
  Stats: 8 lines in 1 file changed: 8 ins; 0 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/26802.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/26802/head:pull/26802

PR: https://git.openjdk.org/jdk/pull/26802


More information about the core-libs-dev mailing list