tmpfiles: avoid out of bounds read

Otherwise this will go wrong for 'v'.
This commit is contained in:
Thomas Hindoe Paaboel Andersen 2015-03-24 23:37:48 +01:00
parent afa91a7231
commit a4135d3234
1 changed files with 1 additions and 1 deletions

View File

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