summaryrefslogtreecommitdiffstats
path: root/crypto/rand
diff options
context:
space:
mode:
authorRich Salz <rsalz@openssl.org>2016-05-29 14:11:44 -0400
committerRich Salz <rsalz@openssl.org>2016-06-01 10:45:18 -0400
commit0f91e1dff4ab2e7c25bbae5a48dfabbd1a4eae3c (patch)
tree96afa283b997bd9ded6976cb2e9b1f7bd351e8ce /crypto/rand
parentf83b85fb0f46f7a3e92651f1e5eb7b1081fb8650 (diff)
Fix some RAND bugs
RT2630 -- segfault for int overlow RT2877 -- check return values in apps/rand Update CHANGES file for previous "windows rand" changes. Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/rand')
-rw-r--r--crypto/rand/md_rand.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/crypto/rand/md_rand.c b/crypto/rand/md_rand.c
index 4b874e3bed..137851f596 100644
--- a/crypto/rand/md_rand.c
+++ b/crypto/rand/md_rand.c
@@ -38,7 +38,7 @@
/* #define PREDICT 1 */
#define STATE_SIZE 1023
-static int state_num = 0, state_index = 0;
+static size_t state_num = 0, state_index = 0;
static unsigned char state[STATE_SIZE + MD_DIGEST_LENGTH];
static unsigned char md[MD_DIGEST_LENGTH];
static long md_count[2] = { 0, 0 };
@@ -268,8 +268,8 @@ static int rand_seed(const void *buf, int num)
static int rand_bytes(unsigned char *buf, int num, int pseudo)
{
static volatile int stirred_pool = 0;
- int i, j, k, st_num, st_idx;
- int num_ceil;
+ int i, j, k;
+ size_t num_ceil, st_idx, st_num;
int ok;
long md_c[2];
unsigned char local_md[MD_DIGEST_LENGTH];