Check random_get_bytes() result before writing entropy file

This commit is contained in:
Jouni Malinen 2011-07-15 17:17:48 +03:00
parent 6cd930cb3c
commit 15f0961447

View File

@ -358,7 +358,8 @@ static void random_write_entropy(void)
if (!random_entropy_file) if (!random_entropy_file)
return; return;
random_get_bytes(buf, RANDOM_ENTROPY_SIZE); if (random_get_bytes(buf, RANDOM_ENTROPY_SIZE) < 0)
return;
f = fopen(random_entropy_file, "wb"); f = fopen(random_entropy_file, "wb");
if (f == NULL) { if (f == NULL) {