fix offset on urandom falback

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2026-03-25 19:30:06 +00:00
parent a6f76ac4ee
commit 0d86fd38df
+1 -1
View File
@@ -52,7 +52,7 @@ rset(void *buf, size_t n)
if ((fd = open("/dev/urandom", O_RDONLY)) < 0) if ((fd = open("/dev/urandom", O_RDONLY)) < 0)
goto err; goto err;
retry_rand: retry_rand:
if ((rc = read(fd, buf, n)) < 0) { if ((rc = read(fd, buf + off, n - off)) < 0) {
#elif defined(__linux__) #elif defined(__linux__)
retry_rand: retry_rand:
if ((rc = (ssize_t)syscall(SYS_getrandom, if ((rc = (ssize_t)syscall(SYS_getrandom,