diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ext/digest/digest.c | 12 |
2 files changed, 17 insertions, 0 deletions
@@ -1,3 +1,8 @@ +Thu Sep 6 13:56:14 2001 Akinori MUSHA <knu@iDaemons.org> + + * ext/digest/digest.c (rb_digest_base_s_digest, + rb_digest_base_s_hexdigest): ensure that a string is given. + Thu Sep 6 13:28:51 2001 WATANABE Hirofumi <eban@ruby-lang.org> * lib/jcode.rb (_regexp_quote): fix quote handling, again. diff --git a/ext/digest/digest.c b/ext/digest/digest.c index f737d254ab..5355776119 100644 --- a/ext/digest/digest.c +++ b/ext/digest/digest.c @@ -96,6 +96,12 @@ rb_digest_base_s_digest(class, str) if (class == cDigest_Base) rb_raise(rb_eNotImpError, "Digest::Base is an abstract class"); +#ifdef StringValue + StringValue(str); +#else + Check_Type(str, T_STRING); +#endif + algo = get_digest_base_metadata(class); pctx = xmalloc(algo->ctx_size); @@ -129,6 +135,12 @@ rb_digest_base_s_hexdigest(class, str) if (class == cDigest_Base) rb_raise(rb_eNotImpError, "Digest::Base is an abstract class"); +#ifdef StringValue + StringValue(str); +#else + Check_Type(str, T_STRING); +#endif + algo = get_digest_base_metadata(class); pctx = xmalloc(algo->ctx_size); |