Document extension clash.
[openssl.git] / crypto / x509 / x509_v3.c
index b5f7daa2e58910dbb22be34141842e79fe78126f..42e6f0ab0560735eaca39bb222796c1c69156862 100644 (file)
@@ -116,7 +116,7 @@ int X509v3_get_ext_by_critical(const STACK_OF(X509_EXTENSION) *sk, int crit,
                {
                ex=sk_X509_EXTENSION_value(sk,lastpos);
                if (    ((ex->critical > 0) && crit) ||
-                       (!(ex->critical <= 0) && !crit))
+                       ((ex->critical <= 0) && !crit))
                        return(lastpos);
                }
        return(-1);
@@ -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: