mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-11 05:52:36 +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
|
||||
n = (size_t)read_dev_urandom(
|
||||
urandom_fd, rnum, sizeof(rnum));
|
||||
|
||||
if (!n || n > sizeof(rnum))
|
||||
err(ECANCELED, "Randomisation failure");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user