Commit 4b85e81b by Michael Santos Committed by Daniel Lezcano

Ensure monitored container name is null terminated

regexec() expects a null terminated name. Signed-off-by: 's avatarMichael Santos <michael.santos@gmail.com> Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
parent 7be9485c
...@@ -70,6 +70,7 @@ void lxc_monitor_send_state(const char *name, lxc_state_t state) ...@@ -70,6 +70,7 @@ void lxc_monitor_send_state(const char *name, lxc_state_t state)
struct lxc_msg msg = { .type = lxc_msg_state, struct lxc_msg msg = { .type = lxc_msg_state,
.value = state }; .value = state };
strncpy(msg.name, name, sizeof(msg.name)); strncpy(msg.name, name, sizeof(msg.name));
msg.name[sizeof(msg.name) - 1] = 0;
lxc_monitor_send(&msg); lxc_monitor_send(&msg);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment