Skip to content

Commit 6bcc912

Browse files
committed
Guard X509 AKID release null
1 parent b5246ed commit 6bcc912

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

native/com_wolfssl_WolfSSLCertificate.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,10 @@ JNIEXPORT jint JNICALL Java_com_wolfssl_WolfSSLCertificate_X509_1set_1authority_
708708
ret = wolfSSL_X509_set_authority_key_id(x509, akidBuf, akidSz);
709709
}
710710

711-
(*jenv)->ReleaseByteArrayElements(jenv, akid, (jbyte*)akidBuf, JNI_ABORT);
711+
if (akidBuf != NULL) {
712+
(*jenv)->ReleaseByteArrayElements(jenv, akid,
713+
(jbyte*)akidBuf, JNI_ABORT);
714+
}
712715

713716
return (jint)ret;
714717
#else

0 commit comments

Comments
 (0)