summaryrefslogtreecommitdiff
path: root/crypto/x509/x509_req.c
diff options
context:
space:
mode:
authorNils Larsch <nils@openssl.org>2006-12-04 19:11:57 +0000
committerNils Larsch <nils@openssl.org>2006-12-04 19:11:57 +0000
commit0f997d0dc3c7e409173a8a6c5bc6bd5f6342a19d (patch)
tree346abacca64b7df7b93dd4b2efadb31554e061dd /crypto/x509/x509_req.c
parentb0eedd77f63f24f593cd6563665deecb7ad4b9a6 (diff)
downloadopenssl-new-0f997d0dc3c7e409173a8a6c5bc6bd5f6342a19d.tar.gz
allocate a new attributes entry in X509_REQ_add_extensions()
if it's NULL (in case of a malformed pkcs10 request) PR: 1347 Submitted by: Remo Inverardi <invi@your.toilet.ch>
Diffstat (limited to 'crypto/x509/x509_req.c')
-rw-r--r--crypto/x509/x509_req.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/crypto/x509/x509_req.c b/crypto/x509/x509_req.c
index ab13bcfc06..3872e1fb64 100644
--- a/crypto/x509/x509_req.c
+++ b/crypto/x509/x509_req.c
@@ -242,6 +242,11 @@ int X509_REQ_add_extensions_nid(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts,
at = NULL;
attr->single = 0;
attr->object = OBJ_nid2obj(nid);
+ if (!req->req_info->attributes)
+ {
+ if (!(req->req_info->attributes = sk_X509_ATTRIBUTE_new_null()))
+ goto err;
+ }
if(!sk_X509_ATTRIBUTE_push(req->req_info->attributes, attr)) goto err;
return 1;
err: