From 8c40acf7cba891ff73f86cf75eba058e8cb495ac Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 18 Jun 2010 23:13:40 +0200 Subject: [PATCH] notify: properly NUL-terminate received messages --- src/manager.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/manager.c b/src/manager.c index c2d5e5f0..dee6109c 100644 --- a/src/manager.c +++ b/src/manager.c @@ -1656,7 +1656,8 @@ static int manager_process_notify_fd(Manager *m) { continue; } - char_array_0(buf); + assert((size_t) n < sizeof(buf)); + buf[n] = 0; if (!(tags = strv_split(buf, "\n\r"))) return -ENOMEM; -- 2.39.5