diff options
-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); |