diff options
author | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-10-15 13:53:32 +0000 |
---|---|---|
committer | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-10-15 13:53:32 +0000 |
commit | b57df3aaa7a1fbbd9dbc85be23ed0cda1a40d99e (patch) | |
tree | 9e328b561bc1e06237a749323421f282b786b794 | |
parent | cd12097a9f6fa103422038579f1f480a1c2100c5 (diff) |
* ext/digest/digest.c (rb_digest_base_s_new): Zero the newly
allocated buffer to avoid letting ALGO_Equal() fail.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@4780 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ext/digest/digest.c | 3 |
2 files changed, 7 insertions, 1 deletions
@@ -1,3 +1,8 @@ +Wed Oct 15 22:51:17 2003 Akinori MUSHA <knu@iDaemons.org> + + * ext/digest/digest.c (rb_digest_base_s_new): Zero the newly + allocated buffer to avoid letting ALGO_Equal() fail. + Sun Aug 3 15:56:27 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org> * math.c (math_log): nan takes a dummy argument on Cygwin 1.5.0. diff --git a/ext/digest/digest.c b/ext/digest/digest.c index 3d47685aac..6f2e895fe4 100644 --- a/ext/digest/digest.c +++ b/ext/digest/digest.c @@ -72,7 +72,8 @@ rb_digest_base_s_new(argc, argv, class) algo = get_digest_base_metadata(class); - pctx = xmalloc(algo->ctx_size); + /* XXX: An uninitialized buffer leads ALGO_Equal() to fail */ + pctx = xcalloc(algo->ctx_size, 1); algo->init_func(pctx); obj = Data_Wrap_Struct(class, 0, free, pctx); |