RFR: 8284855: Update needed to Cleaners added to jdk.crypto.cryptoki [v5]

Brent Christian bchristi at openjdk.java.net
Tue Apr 19 00:16:29 UTC 2022


On Sat, 16 Apr 2022 05:28:39 GMT, Xue-Lei Andrew Fan <xuelei at openjdk.org> wrote:

>> src/jdk.crypto.cryptoki/unix/native/libj2pkcs11/p11_md.c line 274:
>> 
>>> 272:         ModuleData *moduleData = jlong_to_ptr(ckpNativeData);
>>> 273: 
>>> 274:         if (moduleData != NULL) {
>> 
>> The check should be (moduleData->hModule != NULL)? Same goes for the other p11_md.c file.
>
> I think it is safer to add the check for 'hModule'.
> 
> 
> -        if (moduleData != NULL) {
> +        if (moduleData != NULL && moduleData->hModule != NULL) {

That is very safe -- we already checked that `ckpNativeData != 0L`

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

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



More information about the security-dev mailing list