diff --git a/ext/openssl/ossl_asn1.c b/ext/openssl/ossl_asn1.c index 3a07be5cc..dae3bb850 100644 --- a/ext/openssl/ossl_asn1.c +++ b/ext/openssl/ossl_asn1.c @@ -1304,7 +1304,7 @@ ossl_asn1obj_get_oid(VALUE self) val = ossl_asn1_get_value(self); a1obj = obj_to_asn1obj(val); len = OBJ_obj2txt(buf, sizeof(buf), a1obj, 1); - if (len < 0) { + if (len <= 0) { ASN1_OBJECT_free(a1obj); ossl_raise(eASN1Error, "OBJ_obj2txt"); }