summaryrefslogtreecommitdiff
path: root/ext/openssl/ossl_x509attr.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-29 03:19:15 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-29 03:19:15 +0000
commit379fa42f6db7c7f88cc2eddde8326441086e7aed (patch)
tree6151bd088438c84c3474f6930f254d7627e2422f /ext/openssl/ossl_x509attr.c
parent7fc16c237724a5f4377cea47e3434f53d42af5f4 (diff)
* ext/openssl/ossl_x509attr.c (ossl_x509attr_initialize): fix for
initialization of r18168. * ext/openssl/ossl_ocsp.c (ossl_ocspreq_initialize): ditto. * ext/openssl/ossl_x509name.c (ossl_x509name_initialize): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18917 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/openssl/ossl_x509attr.c')
-rw-r--r--ext/openssl/ossl_x509attr.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/openssl/ossl_x509attr.c b/ext/openssl/ossl_x509attr.c
index a876ed5..1f817cd 100644
--- a/ext/openssl/ossl_x509attr.c
+++ b/ext/openssl/ossl_x509attr.c
@@ -92,7 +92,7 @@ static VALUE
ossl_x509attr_initialize(int argc, VALUE *argv, VALUE self)
{
VALUE oid, value;
- X509_ATTRIBUTE *attr;
+ X509_ATTRIBUTE *attr, *x;
const unsigned char *p;
GetX509Attr(self, attr);
@@ -100,7 +100,9 @@ ossl_x509attr_initialize(int argc, VALUE *argv, VALUE self)
oid = ossl_to_der_if_possible(oid);
StringValue(oid);
p = (unsigned char *)RSTRING_PTR(oid);
- if(!d2i_X509_ATTRIBUTE(&attr, &p, RSTRING_LEN(oid)) && (DATA_PTR(self) = attr, 1)){
+ x = d2i_X509_ATTRIBUTE(&attr, &p, RSTRING_LEN(oid));
+ DATA_PTR(self) = attr;
+ if(!x){
ossl_raise(eX509AttrError, NULL);
}
return self;