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;