From: Michael Santos Date: Wed, 16 Mar 2011 14:05:05 +0000 (-0400) Subject: Ensure monitored container name is null terminated X-Git-Tag: lxc-0.7.5~50 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f3bc28bd6128b61efb84906a617e9d09df88eecc;p=thirdparty%2Flxc.git Ensure monitored container name is null terminated regexec() expects a null terminated name. Signed-off-by: Michael Santos Signed-off-by: Daniel Lezcano --- 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); }