diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-04-22 02:56:42 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-04-22 02:56:42 +0200 |
commit | 4f0f902fc8837999e5c9f3a6f7e2592cc6f096eb (patch) | |
tree | 5c752a0e2776784686d57376d48b426bc9952e54 /unit.c | |
parent | c497c7a9e4db487eab4f92421a74d721d9558186 (diff) |
manager: enforce limit on accepted number of names
Diffstat (limited to 'unit.c')
-rw-r--r-- | unit.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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; |