From: Lennart Poettering Date: Wed, 27 Jan 2010 03:56:02 +0000 (+0100) Subject: don't allow zero length unit names X-Git-Tag: 0.git+20100605+dfd8ee-1~401 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=48e11fe8805bf1fcaa9d6231a037eed9cc931a62;p=systemd don't allow zero length unit names --- diff --git a/unit.c b/unit.c index e6e55743..e8d61c85 100644 --- a/unit.c +++ b/unit.c @@ -62,6 +62,9 @@ bool unit_name_is_valid(const char *n) { if (!(e = strrchr(n, '.'))) return false; + if (e == n) + return false; + for (i = n; i < e; i++) if (!strchr(VALID_CHARS, *i)) return false;