mirror of
https://github.com/clearlinux/systemd-stable.git
synced 2026-11-21 13:33:03 +00:00
sd-id128: check that the kernel is feeding us proper data
The characters are already checked, so we show that we don't trust the kernel. Make sure we don't overrun the buffer too.
This commit is contained in:
@@ -170,6 +170,9 @@ _public_ int sd_id128_get_boot(sd_id128_t *ret) {
|
||||
for (j = 0, p = buf; j < 16; j++) {
|
||||
int a, b;
|
||||
|
||||
if (p >= buf + k)
|
||||
return -EIO;
|
||||
|
||||
if (*p == '-')
|
||||
p++;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user