mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-11 14:02:52 +02:00
lbutils: cast to prevent ub in rset()
Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -55,7 +55,7 @@ rset(void *buf, size_t n)
|
||||
if ((fd = open("/dev/urandom", O_RDONLY)) < 0)
|
||||
goto err;
|
||||
retry_rand:
|
||||
if ((rc = read(fd, buf + off, n - off)) < 0) {
|
||||
if ((rc = read(fd, (unsigned char *)buf + off, n - off)) < 0) {
|
||||
#elif defined(__linux__)
|
||||
retry_rand:
|
||||
if ((rc = (ssize_t)syscall(SYS_getrandom,
|
||||
|
||||
Reference in New Issue
Block a user