From ebced817a70c44c685f5fd0eeb441e5db1a8dc02 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Thu, 6 May 2021 10:03:01 +0200 Subject: [PATCH] Ensure argument to printsys() is always nul terminated Signed-off-by: Joachim Wiberg --- src/syslogd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/syslogd.c b/src/syslogd.c index c14c036..a68eec3 100644 --- a/src/syslogd.c +++ b/src/syslogd.c @@ -554,8 +554,11 @@ static void kernel_cb(int fd, void *arg) if (len > 0) memmove(line, p, len + 1); } - if (len > 0) + + if (len > 0) { + line[len] = 0; printsys(line); + } } static int opensys(const char *file)