From f3bc28bd6128b61efb84906a617e9d09df88eecc Mon Sep 17 00:00:00 2001 From: Michael Santos Date: Wed, 16 Mar 2011 10:05:05 -0400 Subject: [PATCH] Ensure monitored container name is null terminated regexec() expects a null terminated name. Signed-off-by: Michael Santos Signed-off-by: Daniel Lezcano --- src/lxc/monitor.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lxc/monitor.c b/src/lxc/monitor.c index 7ec170183..e51b59aac 100644 --- a/src/lxc/monitor.c +++ b/src/lxc/monitor.c @@ -70,6 +70,7 @@ void lxc_monitor_send_state(const char *name, lxc_state_t state) struct lxc_msg msg = { .type = lxc_msg_state, .value = state }; strncpy(msg.name, name, sizeof(msg.name)); + msg.name[sizeof(msg.name) - 1] = 0; lxc_monitor_send(&msg); } -- 2.47.2