diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-03-25 19:51:46 +0000 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-03-25 19:51:46 +0000 |
| commit | 3dd6dd0969cb00ddf34442c0bb9dc1f0632d1c0b (patch) | |
| tree | e24e02e8cdc3c9daa872d2781f34cd1e4f2feab7 | |
| parent | dbfd80497db7d1d099a247e2466832301e5067ec (diff) | |
lbutils, rand: err on zero return (fatal)
Signed-off-by: Leah Rowe <leah@libreboot.org>
| -rw-r--r-- | util/libreboot-utils/lib/rand.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/util/libreboot-utils/lib/rand.c b/util/libreboot-utils/lib/rand.c index b5d6d459..5bf03239 100644 --- a/util/libreboot-utils/lib/rand.c +++ b/util/libreboot-utils/lib/rand.c @@ -70,6 +70,9 @@ retry_rand: goto err; /* possibly unsupported by kernel */ } + if (rc == 0) + goto err; /* prevent infinite loop on fatal err */ + if ((off += (size_t)rc) < n) goto retry_rand; |
