1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-01 17:51:22 +03: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:
Zbigniew Jędrzejewski-Szmek 2013-04-03 16:58:16 -04:00
parent ff03aed06a
commit 54c7d1f454

View File

@ -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++;