mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
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:
1 parent
07fa854a43
commit
f220279c14
1 file changed
+4
@@ -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)
|
||||
|
||||