mirror of
https://github.com/clearlinux/systemd-stable.git
synced 2026-10-04 07:48:36 +00:00
tmpfiles: avoid out of bounds read
Otherwise this will go wrong for 'v'.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user