From e4d65e35e6a26086ec955470baff159f5947f4c3 Mon Sep 17 00:00:00 2001 From: antirez Date: Thu, 22 Jan 2015 11:10:43 +0100 Subject: [PATCH] The seed must be static in getRandomHexChars(). --- src/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util.c b/src/util.c index f995bf1e..543de112 100644 --- a/src/util.c +++ b/src/util.c @@ -431,10 +431,10 @@ int d2string(char *buf, size_t len, double value) { void getRandomHexChars(char *p, unsigned int len) { char *charset = "0123456789abcdef"; unsigned int j; - unsigned char seed[20]; /* A seed to have a different sequence each run. */ /* Global state. */ static int seed_initialized = 0; + static unsigned char seed[20]; /* The SHA1 seed, from /dev/urandom. */ static uint64_t counter = 0; /* The counter we hash with the seed. */ if (!seed_initialized) {