diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-03-25 19:40:27 +0000 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-03-25 19:40:27 +0000 |
| commit | 302ebbedee7b7c0a5e70d402d94615814ed35bc7 (patch) | |
| tree | e46b45d11bad5fc379f91f0b026088f98b5dec8c /util | |
| parent | f5398025ae177b3fb94ea4f9c158edbae6a97560 (diff) | |
lbutils: cast to prevent ub in rset()
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util')
| -rw-r--r-- | util/libreboot-utils/lib/rand.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/util/libreboot-utils/lib/rand.c b/util/libreboot-utils/lib/rand.c index 6a9d1671..8e707ba8 100644 --- a/util/libreboot-utils/lib/rand.c +++ b/util/libreboot-utils/lib/rand.c @@ -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, |
