]> err.no Git - systemd/commitdiff
notify: properly NUL-terminate received messages
authorLennart Poettering <lennart@poettering.net>
Fri, 18 Jun 2010 21:13:40 +0000 (23:13 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 18 Jun 2010 21:13:40 +0000 (23:13 +0200)
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;