chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b78d0be
)
don't allow zero length unit names
author
Lennart Poettering
<lennart@poettering.net>
Wed, 27 Jan 2010 03:56:02 +0000
(
04:56
+0100)
committer
Lennart Poettering
<lennart@poettering.net>
Wed, 27 Jan 2010 03:56:02 +0000
(
04:56
+0100)
unit.c
patch
|
blob
|
history
diff --git
a/unit.c
b/unit.c
index e6e5574312161668f8b7133010cd815bc2267d85..e8d61c853c51529c3fb2b9c4f0917b833632bd73 100644
(file)
--- 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 = strrchr(n, '.')))
return false;
+ if (e == n)
+ return false;
+
for (i = n; i < e; i++)
if (!strchr(VALID_CHARS, *i))
return false;
for (i = n; i < e; i++)
if (!strchr(VALID_CHARS, *i))
return false;