diff options
author | Nobuyoshi Nakada <[email protected]> | 2019-10-10 16:08:39 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2019-10-10 16:25:28 +0900 |
commit | 203b7fa1ae8cc40d41c38d684f70b3fea7fae813 (patch) | |
tree | bfc49055e1a903fe38f4b2f5014516c1ff5e2dd5 /ext/openssl/ossl_asn1.c | |
parent | 6f522455bf801acefcd2ade0b2e4a2fef3cb70a4 (diff) |
Guard static variable first
* ext/openssl/ossl_asn1.c (Init_ossl_asn1): register the static
variable to grab an internal object, before creating the object.
otherwise the just-created object could get collected during the
global variable list allocation. [Bug #16196]
Diffstat (limited to 'ext/openssl/ossl_asn1.c')
-rw-r--r-- | ext/openssl/ossl_asn1.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/openssl/ossl_asn1.c b/ext/openssl/ossl_asn1.c index ab45bd833c..e00c664c54 100644 --- a/ext/openssl/ossl_asn1.c +++ b/ext/openssl/ossl_asn1.c @@ -1823,8 +1823,8 @@ do{\ rb_define_method(cASN1EndOfContent, "initialize", ossl_asn1eoc_initialize, 0); rb_define_method(cASN1EndOfContent, "to_der", ossl_asn1eoc_to_der, 0); - class_tag_map = rb_hash_new(); rb_global_variable(&class_tag_map); + class_tag_map = rb_hash_new(); rb_hash_aset(class_tag_map, cASN1EndOfContent, INT2NUM(V_ASN1_EOC)); rb_hash_aset(class_tag_map, cASN1Boolean, INT2NUM(V_ASN1_BOOLEAN)); rb_hash_aset(class_tag_map, cASN1Integer, INT2NUM(V_ASN1_INTEGER)); |