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