projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
improved error checking and some fixes
[openssl.git]
/
crypto
/
x509
/
x509_att.c
diff --git
a/crypto/x509/x509_att.c
b/crypto/x509/x509_att.c
index bd1fdec2075c4c34cd06a5229a0a3229b91cfe58..65968c4944aab7f2986eec2ee41fc5efbcb4041e 100644
(file)
--- 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;
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;
{
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;
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:
*x=sk;
return(sk);
err: