1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-28 07:21:32 +03:00

bus: never report nodes as children that do not have the right prefix

This commit is contained in:
Lennart Poettering 2013-11-05 21:24:33 +01:00
parent ce6d4630c1
commit 5d66866d96

View File

@ -114,12 +114,17 @@ static int add_enumerated_to_set(
continue;
}
if (!object_path_is_valid(*k) && object_path_startswith(*k, prefix)) {
if (!object_path_is_valid(*k)){
free(*k);
r = -EINVAL;
continue;
}
if (!object_path_startswith(*k, prefix)) {
free(*k);
continue;
}
r = set_consume(s, *k);
}
@ -154,6 +159,9 @@ static int add_subtree_to_set(
LIST_FOREACH(siblings, i, n->child) {
char *t;
if (!object_path_startswith(i->path, prefix))
continue;
t = strdup(i->path);
if (!t)
return -ENOMEM;