chiark / gitweb /
notify: properly NUL-terminate received messages
[elogind.git] / src / manager.c
index c2d5e5f0ef8b84c7f05ae8d1e48a416cae2f1a2a..dee6109c005d35319a731dc3f530388ba1c25274 100644 (file)
@@ -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;