regexec() expects a null terminated name.

Signed-off-by: Michael Santos <michael.san...@gmail.com>
---
 src/lxc/monitor.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/lxc/monitor.c b/src/lxc/monitor.c
index 7ec1701..e51b59a 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);
 }
-- 
1.7.0.4


------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel

Reply via email to