diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-31 04:45:44 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-31 04:45:44 +0000 |
| commit | 8ae0966b1849f878babf9ed0c1418b5c3cffa6dc (patch) | |
| tree | cee49a27cf86641537b9b49922d996a2e17d9950 | |
| parent | d0eacae0a6a6b122c6f2a56f5c440d79ba23f93f (diff) | |
| download | ruby-8ae0966b1849f878babf9ed0c1418b5c3cffa6dc.tar.gz ruby-8ae0966b1849f878babf9ed0c1418b5c3cffa6dc.tar.xz ruby-8ae0966b1849f878babf9ed0c1418b5c3cffa6dc.zip | |
* ext/openssl/ossl_ocsp.c (ossl_ocspres_initialize): fix for
initialization of r18168.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18975 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | ext/openssl/ossl_ocsp.c | 7 |
2 files changed, 9 insertions, 3 deletions
@@ -1,3 +1,8 @@ +Sun Aug 31 13:45:41 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * ext/openssl/ossl_ocsp.c (ossl_ocspres_initialize): fix for + initialization of r18168. + Sun Aug 31 13:42:39 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> * ext/ripper/eventids2.c (ripper_init_eventids2): use rb_intern_const. diff --git a/ext/openssl/ossl_ocsp.c b/ext/openssl/ossl_ocsp.c index 36a3dd704..07a97d82c 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"); } } |
