coverity: #1425753

Copy into fixed size buffer Signed-off-by: 's avatarDonghwa Jeong <dh48.jeong@samsung.com>
parent 21e20322
......@@ -319,7 +319,7 @@ static int lxc_abstract_unix_connect(const char *path)
return -1;
}
/* 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,
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