30 lines
829 B
Diff
30 lines
829 B
Diff
|
From ffd35d89021a9b8375a9246082afc6fc270a93ee Mon Sep 17 00:00:00 2001
|
||
|
From: steven Y Gui <guiyao@huawei.com>
|
||
|
Date: Wed, 14 Jul 2021 16:17:48 +0800
|
||
|
Subject: [PATCH] fread returns element count, not element size
|
||
|
MIME-Version: 1.0
|
||
|
Content-Type: text/plain; charset=UTF-8
|
||
|
Content-Transfer-Encoding: 8bit
|
||
|
|
||
|
Signed-off-by: Björn Esser <besser82@fedoraproject.org>
|
||
|
---
|
||
|
libmisc/salt.c | 2 +-
|
||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||
|
|
||
|
diff --git a/libmisc/salt.c b/libmisc/salt.c
|
||
|
index 9fd34332..91d528fd 100644
|
||
|
--- a/libmisc/salt.c
|
||
|
+++ b/libmisc/salt.c
|
||
|
@@ -168,7 +168,7 @@ static long read_random_bytes (void)
|
||
|
#else
|
||
|
FILE *f = fopen ("/dev/urandom", "r");
|
||
|
|
||
|
- if (fread (&randval, sizeof (randval), 1, f) != sizeof (randval)) {
|
||
|
+ if (fread (&randval, sizeof (randval), 1, f) != 1) {
|
||
|
fclose(f);
|
||
|
goto fail;
|
||
|
}
|
||
|
--
|
||
|
2.31.1
|
||
|
|