ruby-changes:7457
From: nobu <ko1@a...>
Date: Sun, 31 Aug 2008 13:46:04 +0900 (JST)
Subject: [ruby-changes:7457] Ruby:r18975 (trunk, ruby_1_8): * ext/openssl/ossl_ocsp.c (ossl_ocspres_initialize): fix for
nobu 2008-08-31 13:45:44 +0900 (Sun, 31 Aug 2008) New Revision: 18975 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=18975 Log: * ext/openssl/ossl_ocsp.c (ossl_ocspres_initialize): fix for initialization of r18168. Modified files: branches/ruby_1_8/ChangeLog branches/ruby_1_8/ext/openssl/ossl_ocsp.c trunk/ChangeLog trunk/ext/openssl/ossl_ocsp.c Index: ChangeLog =================================================================== --- ChangeLog (revision 18974) +++ ChangeLog (revision 18975) @@ -1,3 +1,8 @@ +Sun Aug 31 13:45:41 2008 Nobuyoshi Nakada <nobu@r...> + + * ext/openssl/ossl_ocsp.c (ossl_ocspres_initialize): fix for + initialization of r18168. + Sun Aug 31 13:42:39 2008 Nobuyoshi Nakada <nobu@r...> * ext/ripper/eventids2.c (ripper_init_eventids2): use rb_intern_const. Index: ext/openssl/ossl_ocsp.c =================================================================== --- ext/openssl/ossl_ocsp.c (revision 18974) +++ ext/openssl/ossl_ocsp.c (revision 18975) @@ -316,12 +316,13 @@ 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"); } } Index: ruby_1_8/ext/openssl/ossl_ocsp.c =================================================================== --- ruby_1_8/ext/openssl/ossl_ocsp.c (revision 18974) +++ ruby_1_8/ext/openssl/ossl_ocsp.c (revision 18975) @@ -316,12 +316,13 @@ 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"); } } Index: ruby_1_8/ChangeLog =================================================================== --- ruby_1_8/ChangeLog (revision 18974) +++ ruby_1_8/ChangeLog (revision 18975) @@ -1,3 +1,8 @@ +Sun Aug 31 13:45:41 2008 Nobuyoshi Nakada <nobu@r...> + + * ext/openssl/ossl_ocsp.c (ossl_ocspres_initialize): fix for + initialization of r18168. + Sat Aug 30 14:59:52 2008 Nobuyoshi Nakada <nobu@r...> * ext/openssl/ossl_x509attr.c (ossl_x509attr_initialize): fix for -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/