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

Guanqiang Han ghan at openjdk.org
Tue Sep 9 03:48:19 UTC 2025


On Wed, 3 Sep 2025 18:40:26 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

>> Guanqiang Han has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Update Class.java
>>   
>>   change overflow check
>
>> /reviewers 2 reviewer
>> 
>> I recommend putting this PR on hold - 65535 encoded size for modified utf8 is significant enough for a cross-JDK utility. As @rose00 suggested, I think I will explore adding a check in ClassFile API, and sharing the check with here.
> 
> A common boolean function is useful and can be better optimized.
> The function should be in a common utility area, but the ClassFile API is a higher level API specific to class files.
> Most developers won't think to look there. The jdk.internal.util.ModifiedUtf isn't a bad place for both the boolean function and the utfLen function.

Hi @RogerRiggs, I’ve made further improvements to the error log , since this PR requires two approvals to merge, could you please review and approve it as well ?  Thanks!

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

PR Comment: https://git.openjdk.org/jdk/pull/26802#issuecomment-3268761091


More information about the core-libs-dev mailing list