We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aa4f190 commit 05b83c8Copy full SHA for 05b83c8
src/node.cc
@@ -1055,9 +1055,11 @@ std::unique_ptr<InitializationResult> InitializeOncePerProcess(
1055
#if defined(__linux__)
1056
FILE* urandom = fopen("/dev/urandom", "rb");
1057
if (urandom) {
1058
- fread(seed, 1, sizeof(seed), urandom);
1059
- fclose(urandom);
+ size_t bytes_read = fread(seed, 1, sizeof(seed), urandom);
+ if (bytes_read == sizeof(seed)) {
1060
RAND_seed(seed, sizeof(seed));
1061
+ }
1062
+ fclose(urandom);
1063
}
1064
#endif
1065
0 commit comments