xenstore: check socket path length before copying it

Coverity-ID: 1055997
Signed-off-by: Matthew Daley <mattjd@gmail.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
This commit is contained in:
Matthew Daley authored and Ian Campbell committed 2013-09-25 13:23:12 +01:00
1 parent 07fa854a43
commit f220279c14
1 file changed
+4
+4
View File
@@ -196,6 +196,10 @@ static int get_socket(const char *connect_to)
goto error;
addr.sun_family = AF_UNIX;
if(strlen(connect_to) >= sizeof(addr.sun_path)) {
errno = EINVAL;
goto error;
}
strcpy(addr.sun_path, connect_to);
if (connect(sock, (struct sockaddr *)&addr, sizeof(addr)) != 0)
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.