Skip to content

Commit

Permalink
Merge pull request #1930 from lifeng68/Fix_parse_err
Browse files Browse the repository at this point in the history
Fix lxc_inherit_namespace function error
  • Loading branch information
Christian Brauner committed Nov 20, 2017
2 parents c4e7852 + 7164956 commit 4671db7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lxc/confile_utils.c
Expand Up @@ -759,8 +759,8 @@ int lxc_inherit_namespace(const char *lxcname_or_pid, const char *lxcpath,
if (!dup)
return -ENOMEM;

*lastslash = '\0';
pid = lxc_container_name_to_pid(lastslash, dup);
dup[lastslash - lxcname_or_pid] = '\0';
pid = lxc_container_name_to_pid(lastslash + 1, dup);
free(dup);
} else {
pid = lxc_container_name_to_pid(lxcname_or_pid, lxcpath);
Expand Down

0 comments on commit 4671db7

Please sign in to comment.