[systemd-commits] src/tmpfiles

Thomas H.P. Andersen phomes at kemper.freedesktop.org
Tue Mar 24 15:53:24 PDT 2015


 src/tmpfiles/tmpfiles.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a4135d32340a5a6cca7a10cc797cafda5451f982
Author: Thomas Hindoe Paaboel Andersen <phomes at gmail.com>
Date:   Tue Mar 24 23:37:48 2015 +0100

    tmpfiles: avoid out of bounds read
    
    Otherwise this will go wrong for 'v'.

diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
index 25c8cfa..55a6a7b 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;
                 }



More information about the systemd-commits mailing list