mirror of https://github.com/BOINC/boinc.git
Lib: check return value of fread() in crypt_prog
fixes CID 27709 found by Coverity
This commit is contained in:
parent
92a4ffb5e6
commit
b51ef0a021
|
@ -108,7 +108,9 @@ unsigned int random_int() {
|
||||||
if (!f) {
|
if (!f) {
|
||||||
die("can't open /dev/random\n");
|
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);
|
fclose(f);
|
||||||
#endif
|
#endif
|
||||||
return n;
|
return n;
|
||||||
|
|
Loading…
Reference in New Issue