diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-03-25 19:30:06 +0000 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-03-25 19:30:06 +0000 |
| commit | 5f0021ce46365de65d21dad7497b30e60be86205 (patch) | |
| tree | 2884b70d78271d6a105b3c16dc9f25a11f328163 | |
| parent | dd599d8f322e6393900562ec782b7888aa1b7876 (diff) | |
fix offset on urandom falback
Signed-off-by: Leah Rowe <leah@libreboot.org>
| -rw-r--r-- | util/libreboot-utils/lib/rand.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/util/libreboot-utils/lib/rand.c b/util/libreboot-utils/lib/rand.c index 9cb52386..11d99ffa 100644 --- a/util/libreboot-utils/lib/rand.c +++ b/util/libreboot-utils/lib/rand.c @@ -52,7 +52,7 @@ rset(void *buf, size_t n) if ((fd = open("/dev/urandom", O_RDONLY)) < 0) goto err; retry_rand: - if ((rc = read(fd, buf, n)) < 0) { + if ((rc = read(fd, buf + off, n - off)) < 0) { #elif defined(__linux__) retry_rand: if ((rc = (ssize_t)syscall(SYS_getrandom, |
