summaryrefslogtreecommitdiff
path: root/crypto/x509/x509_v3.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/x509/x509_v3.c')
-rw-r--r--crypto/x509/x509_v3.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/crypto/x509/x509_v3.c b/crypto/x509/x509_v3.c
index 67b1796a92..42e6f0ab05 100644
--- a/crypto/x509/x509_v3.c
+++ b/crypto/x509/x509_v3.c
@@ -147,7 +147,13 @@ STACK_OF(X509_EXTENSION) *X509v3_add_ext(STACK_OF(X509_EXTENSION) **x,
int n;
STACK_OF(X509_EXTENSION) *sk=NULL;
- if ((x != NULL) && (*x == NULL))
+ if (x == NULL)
+ {
+ X509err(X509_F_X509V3_ADD_EXT,ERR_R_PASSED_NULL_PARAMETER);
+ goto err2;
+ }
+
+ if (*x == NULL)
{
if ((sk=sk_X509_EXTENSION_new_null()) == NULL)
goto err;
@@ -163,7 +169,7 @@ STACK_OF(X509_EXTENSION) *X509v3_add_ext(STACK_OF(X509_EXTENSION) **x,
goto err2;
if (!sk_X509_EXTENSION_insert(sk,new_ex,loc))
goto err;
- if ((x != NULL) && (*x == NULL))
+ if (*x == NULL)
*x=sk;
return(sk);
err: