1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

random.c: clear buf

* random.c (random_seed): clear temporary buffer explicitly.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54994 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2016-05-13 14:56:32 +00:00
parent be33635cd8
commit 678c39dc44

View file

@ -600,9 +600,12 @@ make_seed_value(const uint32_t *ptr)
static VALUE
random_seed(void)
{
VALUE v;
uint32_t buf[DEFAULT_SEED_CNT];
fill_random_seed(buf);
return make_seed_value(buf);
v = make_seed_value(buf);
explicit_bzero(buf, DEFAULT_SEED_LEN);
return v;
}
/*