diff options
author | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-09-06 05:02:29 +0000 |
---|---|---|
committer | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-09-06 05:02:29 +0000 |
commit | 9710bc67ba7ac0e0db9f3066e1bbd72451275ef9 (patch) | |
tree | 0cf01de4d88ed7849a8dc2aa1c59555b69c806aa /ext | |
parent | dd516440e961758a1cb310791dd17eda06c95885 (diff) |
* ext/digest/digest.c (rb_digest_base_s_digest,
rb_digest_base_s_hexdigest): ensure that a string is given.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r-- | ext/digest/digest.c | 12 |
1 files changed, 12 insertions, 0 deletions
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); |