From aa91d5925ac874eab5357b86eb1ca520ba347584 Mon Sep 17 00:00:00 2001 From: Chris Down Date: Fri, 7 Jun 2019 06:22:41 +0100 Subject: [PATCH 1/2] systemctl: Prevent state_missing from being used uninit --- src/systemctl/systemctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index e043afc4f2..1158914fb4 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -1942,7 +1942,7 @@ static void output_machines_list(struct machine_info *machine_infos, unsigned n) statelen = STRLEN("STATE"), failedlen = STRLEN("FAILED"), jobslen = STRLEN("JOBS"); - bool state_missing; + bool state_missing = false; assert(machine_infos || n == 0); From c710d3b4301cffafcd1bded7519176703d3e65c0 Mon Sep 17 00:00:00 2001 From: Chris Down Date: Fri, 7 Jun 2019 06:28:10 +0100 Subject: [PATCH 2/2] cgroup: Prevent theoretical nullptr deref in unit mask calculation --- src/core/cgroup.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/cgroup.c b/src/core/cgroup.c index a7263855dc..0c885d5744 100644 --- a/src/core/cgroup.c +++ b/src/core/cgroup.c @@ -1378,6 +1378,8 @@ static CGroupMask unit_get_cgroup_mask(Unit *u) { c = unit_get_cgroup_context(u); + assert(c); + /* Figure out which controllers we need, based on the cgroup context object */ if (c->cpu_accounting)