From 0fd402b012523306da275fbfec097955ac073e66 Mon Sep 17 00:00:00 2001 From: Alan Jenkins Date: Sun, 10 Dec 2017 10:58:01 +0000 Subject: [PATCH] core: fix undefined behaviour due to uninitialized string buffer (#7597) Failure of systemd to respond on the bus interface was bisected to af6b0ecc "core: make "taint" string logic a bit more generic and output it at boot". Failure was presumably caused by trying to append strings to an unintialized buffer, leading to writing outside the unterminated buffer and hence undefined behaviour. --- src/core/manager.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/manager.c b/src/core/manager.c index 6cf7fd3f303..0681bbbbd24 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -3886,6 +3886,7 @@ char *manager_taint_string(Manager *m) { return NULL; e = buf; + buf[0] = 0; if (m->taint_usr) e = stpcpy(e, "split-usr:"); -- 2.47.3