From 3dd6dd0969cb00ddf34442c0bb9dc1f0632d1c0b Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Wed, 25 Mar 2026 19:51:46 +0000 Subject: lbutils, rand: err on zero return (fatal) Signed-off-by: Leah Rowe --- util/libreboot-utils/lib/rand.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'util/libreboot-utils/lib') 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; -- cgit v1.2.1