don't allow zero length unit names

This commit is contained in:
Lennart Poettering 2010-01-27 04:56:02 +01:00
parent b78d0be16d
commit 48e11fe880
1 changed files with 3 additions and 0 deletions

3
unit.c
View File

@ -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;