tmpfiles: avoid out of bounds read
Otherwise this will go wrong for 'v'.
This commit is contained in:
parent
afa91a7231
commit
a4135d3234
|
@ -830,7 +830,7 @@ static int get_attrib_from_arg(Item *item) {
|
|||
return -EINVAL;
|
||||
}
|
||||
for (; *p ; p++) {
|
||||
if ((uint8_t)*p > ELEMENTSOF(attributes) || attributes[(uint8_t)*p] == 0) {
|
||||
if ((uint8_t)*p >= ELEMENTSOF(attributes) || attributes[(uint8_t)*p] == 0) {
|
||||
log_error("\"%s\": setting ATTR: unknown attr '%c'", item->path, *p);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue