diff options
author | nobu <nobu@ruby-lang.org> | 2008-08-31 04:45:44 +0000 |
---|---|---|
committer | nobu <nobu@ruby-lang.org> | 2008-08-31 04:45:44 +0000 |
commit | 5f19fe509beb0b54abb9149e2683b28e8976bdc9 (patch) | |
tree | 45e8ca36ab08315efe38b7e4ceddd7e44d2e4fc4 /ext | |
parent | 0c7f4f515fc1f0e75be58de7206eb7112c3d0b07 (diff) | |
download | ruby-openssl-history-5f19fe509beb0b54abb9149e2683b28e8976bdc9.tar.gz |
* ext/openssl/ossl_ocsp.c (ossl_ocspres_initialize): fix for
initialization of r18168.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18975 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r-- | ext/openssl/ossl_ocsp.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ext/openssl/ossl_ocsp.c b/ext/openssl/ossl_ocsp.c index 36a3dd7..07a97d8 100644 --- a/ext/openssl/ossl_ocsp.c +++ b/ext/openssl/ossl_ocsp.c @@ -316,12 +316,13 @@ ossl_ocspres_initialize(int argc, VALUE *argv, VALUE self) rb_scan_args(argc, argv, "01", &arg); if(!NIL_P(arg)){ - OCSP_RESPONSE *res = DATA_PTR(self); + OCSP_RESPONSE *res = DATA_PTR(self), *x; arg = ossl_to_der_if_possible(arg); StringValue(arg); p = (unsigned char *)RSTRING_PTR(arg); - if(!d2i_OCSP_RESPONSE(&res, &p, RSTRING_LEN(arg)) && - (DATA_PTR(self) = res, 1)){ + x = d2i_OCSP_RESPONSE(&res, &p, RSTRING_LEN(arg)); + DATA_PTR(self) = res; + if(!x){ ossl_raise(eOCSPError, "cannot load DER encoded response"); } } |