diff options
author | Matthew Daley <mattjd@gmail.com> | 2013-09-18 15:37:56 +1200 |
---|---|---|
committer | Ian Campbell <ian.campbell@citrix.com> | 2013-09-25 13:23:12 +0100 |
commit | f220279c14f5bcbaeb520c4f2498f25d795213e6 (patch) | |
tree | defe7512bfb67ab2f4ecb9ef319dd3e04bb98582 /tools | |
parent | 07fa854a43bfb52fb4abfe7865ef1fb0467bdba7 (diff) | |
download | xen-f220279c14f5bcbaeb520c4f2498f25d795213e6.tar.gz xen-f220279c14f5bcbaeb520c4f2498f25d795213e6.tar.bz2 xen-f220279c14f5bcbaeb520c4f2498f25d795213e6.zip |
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>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/xenstore/xs.c | 4 |
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) |