ruby-changes:61338
From: sinisterchipmunk <ko1@a...>
Date: Sat, 23 May 2020 14:29:34 +0900 (JST)
Subject: [ruby-changes:61338] aa1d3c7d2c (master): [ruby/fiddle] Initialize memory to 0 when calling Fiddle.malloc(). (#24)
https://git.ruby-lang.org/ruby.git/commit/?id=aa1d3c7d2c From aa1d3c7d2c020ec927acaa487e8593172fb64bb0 Mon Sep 17 00:00:00 2001 From: sinisterchipmunk <sinisterchipmunk@g...> Date: Wed, 22 Jan 2020 02:30:22 -0500 Subject: [ruby/fiddle] Initialize memory to 0 when calling Fiddle.malloc(). (#24) https://github.com/ruby/fiddle/commit/8414239ca3 diff --git a/ext/fiddle/fiddle.c b/ext/fiddle/fiddle.c index 9f3d153..bb6b107 100644 --- a/ext/fiddle/fiddle.c +++ b/ext/fiddle/fiddle.c @@ -47,8 +47,9 @@ static VALUE https://github.com/ruby/ruby/blob/trunk/ext/fiddle/fiddle.c#L47 rb_fiddle_malloc(VALUE self, VALUE size) { void *ptr; - - ptr = (void*)ruby_xmalloc(NUM2SIZET(size)); + size_t sizet = NUM2SIZET(size); + ptr = (void*)ruby_xmalloc(sizet); + memset(ptr, 0, sizet); return PTR2NUM(ptr); } -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/