Commit 57e4ad5b authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Andrei Vagin

namespaces: __get_ns_id -- Use safe snprintf

Namespace descriptors are not promised to have
constant short names, so just to be on a safe
side.
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent 78d4f7c3
......@@ -437,7 +437,7 @@ static unsigned int __get_ns_id(int pid, struct ns_desc *nd, protobuf_c_boolean
if (proc_dir < 0)
return 0;
sprintf(ns_path, "ns/%s", nd->str);
snprintf(ns_path, sizeof(ns_path), "ns/%s", nd->str);
if (fstatat(proc_dir, ns_path, &st, 0)) {
if (errno == ENOENT) {
......
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