projects
/
project
/
udebug.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4435143
)
ring: add missing fread return code check
author
Felix Fietkau
<nbd@nbd.name>
Mon, 20 Nov 2023 22:01:59 +0000
(23:01 +0100)
committer
Felix Fietkau
<nbd@nbd.name>
Mon, 20 Nov 2023 22:02:03 +0000
(23:02 +0100)
Fixes build issue with glibc
Signed-off-by: Felix Fietkau <nbd@nbd.name>
ring.c
patch
|
blob
|
history
diff --git
a/ring.c
b/ring.c
index ba75ac56849ad8d3776f7f15e3d1f40cfb559216..8a7e27fc7eb5c6b7d3abbfb545ddd20be878c494 100644
(file)
--- a/
ring.c
+++ b/
ring.c
@@
-22,7
+22,8
@@
static uint32_t gen_ring_id(void)
if (!urandom && (urandom = fopen("/dev/urandom", "r")) == NULL)
return 0;
- fread(&val, sizeof(val), 1, urandom);
+ if (fread(&val, sizeof(val), 1, urandom) != 1)
+ return 0;
return val;
}