[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 20/28] xenstore: check socket path length before copying it



Coverity-ID: 1055997
Signed-off-by: Matthew Daley <mattjd@xxxxxxxxx>
---
 tools/xenstore/xs.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/xenstore/xs.c b/tools/xenstore/xs.c
index 86ef6c7..b1e6820 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)
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.