From: Alan Jenkins Date: Sun, 10 Dec 2017 10:58:01 +0000 (+0000) Subject: core: fix undefined behaviour due to uninitialized string buffer (#7597) X-Git-Tag: v236~30 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0fd402b012523306da275fbfec097955ac073e66;p=thirdparty%2Fsystemd.git 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. --- 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:");