mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-17 18:34:57 +02:00
util/nvmutil: add guard in rhex()
i removed this before, but it's good to put it here defensively, in case i ever mess up the urandom read function again. Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -973,6 +973,9 @@ rhex(void)
|
|||||||
#else
|
#else
|
||||||
n = (size_t)read_dev_urandom(
|
n = (size_t)read_dev_urandom(
|
||||||
urandom_fd, rnum, sizeof(rnum));
|
urandom_fd, rnum, sizeof(rnum));
|
||||||
|
|
||||||
|
if (!n || n > sizeof(rnum))
|
||||||
|
err(ECANCELED, "Randomisation failure");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user