X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=crypto%2Fx509%2Fx509_v3.c;h=42e6f0ab0560735eaca39bb222796c1c69156862;hb=3c786aa6c8c857b18ea48cbb80ec6c0423370c89;hp=b5f7daa2e58910dbb22be34141842e79fe78126f;hpb=9d6b1ce6441c7cc6aed344f02d9f676ab5e04217;p=oweals%2Fopenssl.git diff --git a/crypto/x509/x509_v3.c b/crypto/x509/x509_v3.c index b5f7daa2e5..42e6f0ab05 100644 --- a/crypto/x509/x509_v3.c +++ b/crypto/x509/x509_v3.c @@ -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: