* random.c (make_seed_value): a local array declaration was accessed
out of scope. Coverity Scan found this bug. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8c0033a7b6
commit
e7f484d469
@ -1,3 +1,8 @@
|
|||||||
|
Wed Oct 2 21:37:04 2013 Yusuke Endoh <mame@tsg.ne.jp>
|
||||||
|
|
||||||
|
* random.c (make_seed_value): a local array declaration was accessed
|
||||||
|
out of scope. Coverity Scan found this bug.
|
||||||
|
|
||||||
Wed Oct 2 18:52:40 2013 Koichi Sasada <ko1@atdot.net>
|
Wed Oct 2 18:52:40 2013 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
* gc.c: relax GC condition due to malloc_limit.
|
* gc.c: relax GC condition due to malloc_limit.
|
||||||
|
2
random.c
2
random.c
@ -495,10 +495,10 @@ make_seed_value(const uint32_t *ptr)
|
|||||||
{
|
{
|
||||||
VALUE seed;
|
VALUE seed;
|
||||||
size_t len;
|
size_t len;
|
||||||
|
uint32_t buf[DEFAULT_SEED_CNT+1];
|
||||||
|
|
||||||
if (ptr[DEFAULT_SEED_CNT-1] <= 1) {
|
if (ptr[DEFAULT_SEED_CNT-1] <= 1) {
|
||||||
/* set leading-zero-guard */
|
/* set leading-zero-guard */
|
||||||
uint32_t buf[DEFAULT_SEED_CNT+1];
|
|
||||||
MEMCPY(buf, ptr, uint32_t, DEFAULT_SEED_CNT);
|
MEMCPY(buf, ptr, uint32_t, DEFAULT_SEED_CNT);
|
||||||
buf[DEFAULT_SEED_CNT] = 1;
|
buf[DEFAULT_SEED_CNT] = 1;
|
||||||
ptr = buf;
|
ptr = buf;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user