JDK-8338888 : SystemDictionary::class_name_symbol has incorrect length check
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 8
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2024-08-23
  • Updated: 2024-09-02
  • Resolved: 2024-08-28
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 24
24 b13Fixed
Related Reports
Relates :  
Relates :  
Description
The code has:

if ((int)strlen(name) > Symbol::max_length()) {

when it should have 

if (strlen(name) > (size_t)Symbol::max_length()) {

otherwise string lengths > INT_MAX will give a negative result and so fail the comparison and so not get caught as being too long.
Comments
Changeset: 72a49005 Branch: master Author: David Holmes <dholmes@openjdk.org> Date: 2024-08-28 21:16:18 +0000 URL: https://git.openjdk.org/jdk/commit/72a49005ee8c4aeb6dcf3eff4c56576a2b4d0081
28-08-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/20709 Date: 2024-08-26 02:49:42 +0000
26-08-2024

In 8u and 11u the bad check is in jni_FindClass and jni_DefineClass.
23-08-2024