Unverified Commit 3380e58a by LiFeng Committed by Christian Brauner

Add return check for 'lxc_cmd_get_name'

If 'lxc_cmd_get_name' failed and return with NULL, this would cause a segment fault. Signed-off-by: 's avatarLiFeng <lifeng68@huawei.com>
parent 6b489ff5
...@@ -4618,6 +4618,8 @@ int list_active_containers(const char *lxcpath, char ***nret, ...@@ -4618,6 +4618,8 @@ int list_active_containers(const char *lxcpath, char ***nret,
if (strncmp(lxcpath, recvpath, lxcpath_len) != 0) if (strncmp(lxcpath, recvpath, lxcpath_len) != 0)
continue; continue;
p = lxc_cmd_get_name(p); p = lxc_cmd_get_name(p);
if (!p)
continue;
} }
if (array_contains(&ct_name, p, ct_name_cnt)) if (array_contains(&ct_name, p, ct_name_cnt))
......
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