diff options
author | Thomas Hindoe Paaboel Andersen <phomes@gmail.com> | 2015-03-24 23:37:48 +0100 |
---|---|---|
committer | Thomas Hindoe Paaboel Andersen <phomes@gmail.com> | 2015-03-24 23:53:09 +0100 |
commit | a4135d32340a5a6cca7a10cc797cafda5451f982 (patch) | |
tree | 3adee56521482fb46d61d7d157e344772dcb18ce /src/tmpfiles/tmpfiles.c | |
parent | rules: storage - support MemoryStick (non-Pro) cards (diff) | |
download | systemd-a4135d32340a5a6cca7a10cc797cafda5451f982.tar.xz systemd-a4135d32340a5a6cca7a10cc797cafda5451f982.zip |
tmpfiles: avoid out of bounds read
Otherwise this will go wrong for 'v'.
Diffstat (limited to '')
-rw-r--r-- | src/tmpfiles/tmpfiles.c | 2 |
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; } |