diff options
Diffstat (limited to 'ext/digest/digest.c')
-rw-r--r-- | ext/digest/digest.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/digest/digest.c b/ext/digest/digest.c index c603441409..02fc12bd63 100644 --- a/ext/digest/digest.c +++ b/ext/digest/digest.c @@ -356,7 +356,8 @@ rb_digest_instance_equal(VALUE self, VALUE other) str2 = rb_digest_instance_digest(0, 0, other); } else { str1 = rb_digest_instance_to_s(self); - str2 = other; + str2 = rb_check_string_type(other); + if (NIL_P(str2)) return Qfalse; } /* never blindly assume that subclass methods return strings */ |