summaryrefslogtreecommitdiff
path: root/ext/openssl/ossl_asn1.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/openssl/ossl_asn1.c')
-rw-r--r--ext/openssl/ossl_asn1.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/openssl/ossl_asn1.c b/ext/openssl/ossl_asn1.c
index a961c16bc0f..abea6f5f0c7 100644
--- a/ext/openssl/ossl_asn1.c
+++ b/ext/openssl/ossl_asn1.c
@@ -816,6 +816,7 @@ ossl_asn1_traverse(VALUE self, VALUE obj)
obj = ossl_to_der_if_possible(obj);
StringValue(obj);
+ obj = rb_str_new4(obj);
p = RSTRING(obj)->ptr;
ossl_asn1_decode0(&p, RSTRING(obj)->len, &offset, 0, 0, 1);
@@ -831,6 +832,7 @@ ossl_asn1_decode(VALUE self, VALUE obj)
obj = ossl_to_der_if_possible(obj);
StringValue(obj);
+ obj = rb_str_new4(obj);
p = RSTRING(obj)->ptr;
ary = ossl_asn1_decode0(&p, RSTRING(obj)->len, &offset, 0, 1, 0);
ret = rb_ary_entry(ary, 0);
@@ -847,6 +849,7 @@ ossl_asn1_decode_all(VALUE self, VALUE obj)
obj = ossl_to_der_if_possible(obj);
StringValue(obj);
+ obj = rb_str_new4(obj);
p = RSTRING(obj)->ptr;
ret = ossl_asn1_decode0(&p, RSTRING(obj)->len, &offset, 0, 0, 0);