diff --git a/ChangeLog b/ChangeLog index 95d3a3df6d..5c14731632 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Sep 6 13:56:14 2001 Akinori MUSHA + + * 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 * 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);