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_att.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_att.c')
-rw-r--r-- | crypto/x509/x509_att.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/crypto/x509/x509_att.c b/crypto/x509/x509_att.c index bd1fdec207..65968c4944 100644 --- a/crypto/x509/x509_att.c +++ b/crypto/x509/x509_att.c @@ -125,7 +125,13 @@ STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x, X509_ATTRIBUTE *new_attr=NULL; STACK_OF(X509_ATTRIBUTE) *sk=NULL; - if ((x != NULL) && (*x == NULL)) + if (x == NULL) + { + X509err(X509_F_X509AT_ADD1_ATTR, ERR_R_PASSED_NULL_PARAMETER); + goto err2; + } + + if (*x == NULL) { if ((sk=sk_X509_ATTRIBUTE_new_null()) == NULL) goto err; @@ -137,7 +143,7 @@ STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x, goto err2; if (!sk_X509_ATTRIBUTE_push(sk,new_attr)) goto err; - if ((x != NULL) && (*x == NULL)) + if (*x == NULL) *x=sk; return(sk); err: |