mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 18:57:27 +02:00
add sanity check
This commit is contained in:
@ -49998,6 +49998,9 @@ static int x509GetIssuerFromCM(WOLFSSL_X509 **issuer, WOLFSSL_CERT_MANAGER* cm,
|
||||
#else
|
||||
DecodedCert cert[1];
|
||||
#endif
|
||||
/* sanity check */
|
||||
if (cm == NULL || x == NULL || x->derCert == NULL)
|
||||
return WOLFSSL_FAILURE;
|
||||
|
||||
#ifdef WOLFSSL_SMALL_STACK
|
||||
cert = (DecodedCert*)XMALLOC(sizeof(DecodedCert), NULL, DYNAMIC_TYPE_DCERT);
|
||||
@ -50178,7 +50181,7 @@ WOLFSSL_X509* wolfSSL_X509_dup(WOLFSSL_X509 *x)
|
||||
{
|
||||
WOLFSSL_ENTER("wolfSSL_X509_dup");
|
||||
|
||||
if (x == NULL) {
|
||||
if (x == NULL || x->derCert == NULL) {
|
||||
WOLFSSL_MSG("Error: NULL certificate passed in");
|
||||
return NULL;
|
||||
}
|
||||
|
Reference in New Issue
Block a user