projects
/
xen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
07fa854
)
xenstore: check socket path length before copying it
author
Matthew Daley
<mattjd@gmail.com>
Wed, 18 Sep 2013 03:37:56 +0000
(15:37 +1200)
committer
Ian Campbell
<ian.campbell@citrix.com>
Wed, 25 Sep 2013 12:23:12 +0000
(13:23 +0100)
Coverity-ID:
1055997
Signed-off-by: Matthew Daley <mattjd@gmail.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/xenstore/xs.c
patch
|
blob
|
history
diff --git
a/tools/xenstore/xs.c
b/tools/xenstore/xs.c
index 86ef6c7f3e6f8e547905b3517d9643a2b054ea2c..b1e6820cf441c4133c8f20ab9460f84c3328d682 100644
(file)
--- 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)