add null check for ssl before use in wc_DhGenerateKeyPair

This commit is contained in:
Ruby Martin
2025-07-02 15:48:25 -06:00
parent 65f9cdb498
commit 61e4142fe0

View File

@@ -6468,6 +6468,10 @@ int DhGenKeyPair(WOLFSSL* ssl, DhKey* dhKey,
WOLFSSL_ENTER("DhGenKeyPair");
if (ssl == NULL || dhKey == NULL) {
return BAD_FUNC_ARG;
}
#ifdef WOLFSSL_ASYNC_CRYPT
/* initialize event */
ret = wolfSSL_AsyncInit(ssl, &dhKey->asyncDev, WC_ASYNC_FLAG_NONE);