Unverified Commit 7e0997c7 by Christian Brauner Committed by GitHub

Merge pull request #2387 from 2xsec/coverity

coverity: #1425753
parents 21e20322 98c7c8eb
...@@ -319,7 +319,7 @@ static int lxc_abstract_unix_connect(const char *path) ...@@ -319,7 +319,7 @@ static int lxc_abstract_unix_connect(const char *path)
return -1; return -1;
} }
/* addr.sun_path[0] has already been set to 0 by memset() */ /* addr.sun_path[0] has already been set to 0 by memset() */
memcpy(&addr.sun_path[1], &path[1], strlen(&path[1])); memcpy(&addr.sun_path[1], &path[1], len);
ret = connect(fd, (struct sockaddr *)&addr, ret = connect(fd, (struct sockaddr *)&addr,
offsetof(struct sockaddr_un, sun_path) + len + 1); offsetof(struct sockaddr_un, sun_path) + len + 1);
......
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