diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-30 05:58:38 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-30 05:58:38 +0000 |
commit | 5ac5520a30eb3108e8a9071d3d6dd3cb4c7e5d8d (patch) | |
tree | 52e73f154ab0f3a178d7f3785ca844bb520f7efc /ext/openssl | |
parent | 3695844deadd90e1891b8952c849c18c76524bf9 (diff) | |
download | ruby-5ac5520a30eb3108e8a9071d3d6dd3cb4c7e5d8d.tar.gz ruby-5ac5520a30eb3108e8a9071d3d6dd3cb4c7e5d8d.tar.xz ruby-5ac5520a30eb3108e8a9071d3d6dd3cb4c7e5d8d.zip |
* ext/openssl/ossl_x509ext.c (ossl_x509ext_initialize): fix for
initialization of r18168.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18942 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/openssl')
-rw-r--r-- | ext/openssl/ossl_x509ext.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/openssl/ossl_x509ext.c b/ext/openssl/ossl_x509ext.c index b87b027e0..f08006f34 100644 --- a/ext/openssl/ossl_x509ext.c +++ b/ext/openssl/ossl_x509ext.c @@ -275,14 +275,16 @@ ossl_x509ext_initialize(int argc, VALUE *argv, VALUE self) { VALUE oid, value, critical; const unsigned char *p; - X509_EXTENSION *ext, *x = DATA_PTR(self); + X509_EXTENSION *ext, *x; GetX509Ext(self, ext); if(rb_scan_args(argc, argv, "12", &oid, &value, &critical) == 1){ oid = ossl_to_der_if_possible(oid); StringValue(oid); p = (unsigned char *)RSTRING_PTR(oid); - if(!d2i_X509_EXTENSION(&x, &p, RSTRING_LEN(oid)) && (DATA_PTR(self) = x, 1)) + x = d2i_X509_EXTENSION(&ext, &p, RSTRING_LEN(oid)); + DATA_PTR(self) = ext; + if(!x) ossl_raise(eX509ExtError, NULL); return self; } |