summaryrefslogtreecommitdiff
path: root/unit.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-04-22 02:56:42 +0200
committerLennart Poettering <lennart@poettering.net>2010-04-22 02:56:42 +0200
commit4f0f902fc8837999e5c9f3a6f7e2592cc6f096eb (patch)
tree5c752a0e2776784686d57376d48b426bc9952e54 /unit.c
parentc497c7a9e4db487eab4f92421a74d721d9558186 (diff)
manager: enforce limit on accepted number of names
Diffstat (limited to 'unit.c')
-rw-r--r--unit.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/unit.c b/unit.c
index 5c19b3b2da..3f2538a694 100644
--- a/unit.c
+++ b/unit.c
@@ -125,6 +125,11 @@ int unit_add_name(Unit *u, const char *text) {
goto fail;
}
+ if (hashmap_size(u->meta.manager->units) >= MANAGER_MAX_NAMES) {
+ r = -E2BIG;
+ goto fail;
+ }
+
if ((r = set_put(u->meta.names, s)) < 0) {
if (r == -EEXIST)
r = 0;