diff options
author | Nils Larsch <nils@openssl.org> | 2005-07-26 21:10:34 +0000 |
---|---|---|
committer | Nils Larsch <nils@openssl.org> | 2005-07-26 21:10:34 +0000 |
commit | c755c5fd8ba5771691451e9d1b163544fdadb7ec (patch) | |
tree | e9ba80b2ad6965f3803a0d2273b8797258023586 /crypto/x509/x509_v3.c | |
parent | 5c8e9139d18ca20fd4a6f194697d2e2634009cca (diff) |
improved error checking and some fixes
PR: 1170
Submitted by: Yair Elharrar
Reviewed and edited by: Nils Larsch
Diffstat (limited to 'crypto/x509/x509_v3.c')
-rw-r--r-- | crypto/x509/x509_v3.c | 10 |
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: |