summaryrefslogtreecommitdiff
path: root/util/libreboot-utils
diff options
context:
space:
mode:
Diffstat (limited to 'util/libreboot-utils')
-rw-r--r--util/libreboot-utils/lib/rand.c3
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;