summaryrefslogtreecommitdiff
path: root/random.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-13 14:56:32 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-13 14:56:32 (GMT)
commit678c39dc44d821ed1ecf8694cf254a21af0be527 (patch)
tree04070755d8def05b599e8c3dddc5723e51a202f7 /random.c
parentbe33635cd88fbe98fe41c9e882a0cf70f58f4ab4 (diff)
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
Diffstat (limited to 'random.c')
-rw-r--r--random.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/random.c b/random.c
index a3476d5..f9f087c 100644
--- a/random.c
+++ b/random.c
@@ -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;
}
/*