diff --git a/lib/crypt_prog.cpp b/lib/crypt_prog.cpp index 4318ca7e01..2a1eb5dea7 100644 --- a/lib/crypt_prog.cpp +++ b/lib/crypt_prog.cpp @@ -108,7 +108,9 @@ unsigned int random_int() { if (!f) { die("can't open /dev/random\n"); } - fread(&n, sizeof(n), 1, f); + if (1 != fread(&n, sizeof(n), 1, f)) { + die("couldn't read from /dev/random\n"); + } fclose(f); #endif return n;