]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
fread returns element count, not element size 381/head 382/head
authorsteven Y Gui <guiyao@huawei.com>
Wed, 14 Jul 2021 08:17:48 +0000 (16:17 +0800)
committersteven Y Gui <guiyao@huawei.com>
Wed, 14 Jul 2021 08:17:48 +0000 (16:17 +0800)
libmisc/salt.c

index 9fd3433281eca578b5cc6557dfe17e5fe73d7054..91d528fda5b4e2150acaa962156a75c5ebbf6ee9 100644 (file)
@@ -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;
        }