8000 * ext/digest/digest.c (rb_digest_base_s_new): Zero the newly · documenting-ruby/ruby@b57df3a · GitHub
[go: up one dir, main page]

Skip to content 8000

Commit b57df3a

Browse files
committed
* 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
1 parent cd12097 commit b57df3a

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
Wed Oct 15 22:51:17 2003 Akinori MUSHA <knu@iDaemons.org>
2+
3+
* ext/digest/digest.c (rb_digest_base_s_new): Zero the newly
4+
allocated buffer to avoid letting ALGO_Equal() fail.
5+
16
Sun Aug 3 15:56:27 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
27

38
* math.c (math_log): nan takes a dummy argument on Cygwin 1.5.0.

ext/digest/digest.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ rb_digest_base_s_new(argc, argv, class)
7272

7373
algo = get_digest_base_metadata(class);
7474

75-
pctx = xmalloc(algo->ctx_size);
75+
/* XXX: An uninitialized buffer leads ALGO_Equal() to fail */
76+
pctx = xcalloc(algo->ctx_size, 1);
7677
algo->init_func(pctx);
7778

7879
obj = Data_Wrap_Struct(class, 0, free, pctx);

0 commit comments

Comments
 (0)
0