summaryrefslogtreecommitdiff
path: root/random.c
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-02 12:41:08 (GMT)
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-02 12:41:08 (GMT)
commite7f484d469a9cb880501f47b0651378dbf4444f0 (patch)
tree703d254d7a25ebf38df57e7854a7a09f6a819b95 /random.c
parent8c0033a7b625ebf8d3f809791a90512464efdbed (diff)
* 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
Diffstat (limited to 'random.c')
-rw-r--r--random.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/random.c b/random.c
index 289c24d..4026614 100644
--- a/random.c
+++ b/random.c
@@ -495,10 +495,10 @@ make_seed_value(const uint32_t *ptr)
{
VALUE seed;
size_t len;
+ uint32_t buf[DEFAULT_SEED_CNT+1];
if (ptr[DEFAULT_SEED_CNT-1] <= 1) {
/* set leading-zero-guard */
- uint32_t buf[DEFAULT_SEED_CNT+1];
MEMCPY(buf, ptr, uint32_t, DEFAULT_SEED_CNT);
buf[DEFAULT_SEED_CNT] = 1;
ptr = buf;