On Wed, 3 Feb 2021 19:49:30 GMT, Mandy Chung <mch...@openjdk.org> wrote:

>> This patch moves some sanity checking done in ClassLoader.java to the 
>> corresponding endpoints in native or VM code.
>
> src/java.base/share/native/libjava/ClassLoader.c line 291:
> 
>> 289:     }
>> 290:     // disallow slashes in input, change '.' to '/'
>> 291:     if (verifyFixClassname(clname)) {
> 
> perhaps we should replace all use of `fixClassname` with `verifyFixClassname` 
> and remove `fixClassname`.

This suggestion makes sense to me.  verifyClassName is only used once in 
Class.c passing false so you could remove that argument.
It's hard to see how fixClassName then verifyClassname is equivalent to 
verifyFixClassname but verifyFixClassname makes more sense than verifyClassname.
I think this return:
    return (p != 0 && p - name == (ptrdiff_t)length);
implies a non-utf8 character was found?

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

PR: https://git.openjdk.java.net/jdk/pull/2378

Reply via email to