Skip to content

Commit fe6f6cc

Browse files
committed
Guard X509 load cert release null
1 parent 2145999 commit fe6f6cc

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
@@ -1029,7 +1029,10 @@ JNIEXPORT jlong JNICALL Java_com_wolfssl_WolfSSLCertificate_X509_1load_1certific
10291029
}
10301030

10311031
/* release array, don't copy back contents */
1032-
(*jenv)->ReleaseByteArrayElements(jenv, in, (jbyte*)certBuf, JNI_ABORT);
1032+
if (certBuf != NULL) {
1033+
(*jenv)->ReleaseByteArrayElements(jenv, in,
1034+
(jbyte*)certBuf, JNI_ABORT);
1035+
}
10331036

10341037
return (jlong)(uintptr_t)x509;
10351038
}

0 commit comments

Comments
 (0)