mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-11 05:52:36 +02:00
lbutils/rand: close fd on urandom error
Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -175,11 +175,14 @@ retry_rand: {
|
|||||||
#error Unsupported operating system (possibly unsecure randomisation)
|
#error Unsupported operating system (possibly unsecure randomisation)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (rc < 0)
|
if (rc < 0 || /* syscall fehler */
|
||||||
goto err; /* syscall fehler */
|
rc == 0) { /* prevent infinite loop on fatal err */
|
||||||
|
#if defined(USE_URANDOM) && \
|
||||||
if (rc == 0)
|
((USE_URANDOM) > 0)
|
||||||
goto err; /* prevent infinite loop on fatal err */
|
close_on_eintr(&fd);
|
||||||
|
#endif
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
if ((off += (size_t)rc) < n)
|
if ((off += (size_t)rc) < n)
|
||||||
goto retry_rand;
|
goto retry_rand;
|
||||||
|
|||||||
Reference in New Issue
Block a user