aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xenstore/xs.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/xenstore/xs.c')
-rw-r--r--tools/xenstore/xs.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/xenstore/xs.c b/tools/xenstore/xs.c
index 86ef6c7f3e..b1e6820cf4 100644
--- a/tools/xenstore/xs.c
+++ b/tools/xenstore/xs.c
@@ -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)