aboutsummaryrefslogtreecommitdiffstats
path: root/ext/openssl/ossl_ssl_session.c
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2017-07-06 09:21:36 +0900
committerKazuki Yamaguchi <k@rhe.jp>2017-07-11 13:20:24 +0900
commit3af2635f117f8da563d180bc1c58702aecb16e0c (patch)
tree14e6b96336f2aa7afbc4411c0beccd5ffa48bbda /ext/openssl/ossl_ssl_session.c
parent261353a42d0dc0e7bf73e5a8fb8ecffd04249d42 (diff)
downloadruby-openssl-3af2635f117f8da563d180bc1c58702aecb16e0c.tar.gz
bio: prevent possible GC issue in ossl_obj2bio()
Prevent the new object created by StringValue() from being GCed. Luckily, as none of the callers of ossl_obj2bio() reads from the returned BIO after possible triggering GC, this has not been a real problem. As a bonus, ossl_protect_obj2bio() function which is no longer used anywhere is removed.
Diffstat (limited to 'ext/openssl/ossl_ssl_session.c')
-rw-r--r--ext/openssl/ossl_ssl_session.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/openssl/ossl_ssl_session.c b/ext/openssl/ossl_ssl_session.c
index 1b602a6c..661f53ee 100644
--- a/ext/openssl/ossl_ssl_session.c
+++ b/ext/openssl/ossl_ssl_session.c
@@ -49,7 +49,7 @@ static VALUE ossl_ssl_session_initialize(VALUE self, VALUE arg1)
if ((ctx = SSL_get1_session(ssl)) == NULL)
ossl_raise(eSSLSession, "no session available");
} else {
- BIO *in = ossl_obj2bio(arg1);
+ BIO *in = ossl_obj2bio(&arg1);
ctx = PEM_read_bio_SSL_SESSION(in, NULL, NULL, NULL);