aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-14 23:21:31 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-14 23:21:31 +0000
commit1e30933a132ad22f5d0aaaedf5b0d0e57216eae8 (patch)
tree283c7bcb9b403ff4d46e9c004a7e6f2d837c5930
parent1d4504be511959602b56297ad3953392234dc617 (diff)
downloadruby-1e30933a132ad22f5d0aaaedf5b0d0e57216eae8.tar.gz
random.c: clear seed
* random.c (rand_init): clear packed seed value explicitly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55004 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--random.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/random.c b/random.c
index 1770adf138..3be22a4ec0 100644
--- a/random.c
+++ b/random.c
@@ -387,6 +387,7 @@ rand_init(struct MT *mt, VALUE seed)
len--;
init_by_array(mt, buf, (int)len);
}
+ explicit_bzero(buf, len * sizeof(*buf));
if (buf != buf0) xfree(buf);
return seed;
}