diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-08-26 12:42:11 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-08-26 12:46:41 +0100 |
commit | e827f80e5c07ac13802a24753b249e05e18a290e (patch) | |
tree | 6ee2fb291be37dc4b68c99e8f16ce6d2f829530c /tools | |
parent | 51037706b068b52b7c8984527c209d295e1e3584 (diff) |
intel-virtual-output: Sanity check length on user supplied socket path
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Suggested-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/virtual.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/virtual.c b/tools/virtual.c index 83b934aa..9b1912f8 100644 --- a/tools/virtual.c +++ b/tools/virtual.c @@ -2387,7 +2387,8 @@ static int bumblebee_open(struct context *ctx) } addr.sun_family = AF_UNIX; - strcpy(addr.sun_path, optarg && *optarg ? optarg : "/var/run/bumblebee.socket"); + strncpy(addr.sun_path, sizeof(addr.sun_path), + optarg && *optarg ? optarg : "/var/run/bumblebee.socket"); if (connect(fd, (struct sockaddr *)&addr, sizeof(addr)) < 0) { DBG(X11, ("%s unable to create a socket: %d\n", __func__, errno)); goto err; |