chiark / gitweb /
tmpfiles: avoid out of bounds read
[elogind.git] / src / tmpfiles / tmpfiles.c
index 25c8cfa6946e6bfe62c7394289ab1a2b2ec5e8ae..55a6a7bb54505528744983251d80ae5af7e8f71e 100644 (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;
                 }