summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>2015-03-24 23:37:48 +0100
committerThomas Hindoe Paaboel Andersen <phomes@gmail.com>2015-03-24 23:53:09 +0100
commita4135d32340a5a6cca7a10cc797cafda5451f982 (patch)
tree3adee56521482fb46d61d7d157e344772dcb18ce /src
parentafa91a72315b7becfe753dcba1f337578f15caff (diff)
tmpfiles: avoid out of bounds read
Otherwise this will go wrong for 'v'.
Diffstat (limited to 'src')
-rw-r--r--src/tmpfiles/tmpfiles.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
index 25c8cfa694..55a6a7bb54 100644
--- a/src/tmpfiles/tmpfiles.c
+++ b/src/tmpfiles/tmpfiles.c
@@ -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;
}