summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-01-27 04:56:02 +0100
committerLennart Poettering <lennart@poettering.net>2010-01-27 04:56:02 +0100
commit48e11fe8805bf1fcaa9d6231a037eed9cc931a62 (patch)
tree91e463fe11e9513bacc7d9bb480170bf423f5b2e
parentb78d0be16db0e28371dd4045b502e28db9d6c78f (diff)
don't allow zero length unit names
-rw-r--r--unit.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/unit.c b/unit.c
index e6e5574312..e8d61c853c 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;