From: Jouni Malinen Date: Fri, 15 Jul 2011 14:17:48 +0000 (+0300) Subject: Check random_get_bytes() result before writing entropy file X-Git-Tag: hostap-1-bp~306 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=15f0961447f9865640505378b4d63207f3c1aa5f;p=thirdparty%2Fhostap.git Check random_get_bytes() result before writing entropy file --- diff --git a/src/crypto/random.c b/src/crypto/random.c index f545917a7..7f5c08a6d 100644 --- a/src/crypto/random.c +++ b/src/crypto/random.c @@ -358,7 +358,8 @@ static void random_write_entropy(void) if (!random_entropy_file) return; - random_get_bytes(buf, RANDOM_ENTROPY_SIZE); + if (random_get_bytes(buf, RANDOM_ENTROPY_SIZE) < 0) + return; f = fopen(random_entropy_file, "wb"); if (f == NULL) {