diff options
author | Kazuki Yamaguchi <k@rhe.jp> | 2016-09-08 18:11:12 +0900 |
---|---|---|
committer | Kazuki Yamaguchi <k@rhe.jp> | 2016-09-08 18:21:39 +0900 |
commit | 34e7fe34ee326d8d0ceb594d0fe5a90c22d91c63 (patch) | |
tree | 5d0d5aa2bdca8d8e7363c6acbb7aecccf23d9ea4 /ext/openssl/ossl_asn1.c | |
parent | a7940a22e0a5caeab4f0d8b96b9a977f6bf31133 (diff) | |
download | ruby-openssl-34e7fe34ee326d8d0ceb594d0fe5a90c22d91c63.tar.gz |
Use rb_obj_class() instead of CLASS_OF()
CLASS_OF() (or, rb_class_of()) may return the singleton class of the
object; so avoid using it and replace with rb_obj_class() that returns
the actual class of the object.
Diffstat (limited to 'ext/openssl/ossl_asn1.c')
-rw-r--r-- | ext/openssl/ossl_asn1.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/openssl/ossl_asn1.c b/ext/openssl/ossl_asn1.c index 85b1f02e..2a580d66 100644 --- a/ext/openssl/ossl_asn1.c +++ b/ext/openssl/ossl_asn1.c @@ -1264,8 +1264,8 @@ ossl_asn1cons_to_der(VALUE self) if (inf_length == Qtrue) { VALUE ary, example; constructed = 2; - if (CLASS_OF(self) == cASN1Sequence || - CLASS_OF(self) == cASN1Set) { + if (rb_obj_class(self) == cASN1Sequence || + rb_obj_class(self) == cASN1Set) { tag = ossl_asn1_default_tag(self); } else { /* must be a constructive encoding of a primitive value */ @@ -1294,7 +1294,7 @@ ossl_asn1cons_to_der(VALUE self) } } else { - if (CLASS_OF(self) == cASN1Constructive) + if (rb_obj_class(self) == cASN1Constructive) ossl_raise(eASN1Error, "Constructive shall only be used with infinite length"); tag = ossl_asn1_default_tag(self); } |