From 1cb964148482b2d50b1f82966f96545ebeec6428 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Mon, 14 Apr 2014 08:50:33 -0600 Subject: [PATCH] client: fix potential buffer overrun in socket path Signed-off-by: Jens Axboe --- client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client.c b/client.c index 05439e1d..af6621dc 100644 --- a/client.c +++ b/client.c @@ -388,7 +388,7 @@ static int fio_client_connect_sock(struct fio_client *client) memset(addr, 0, sizeof(*addr)); addr->sun_family = AF_UNIX; - strcpy(addr->sun_path, client->hostname); + strncpy(addr->sun_path, client->hostname, sizeof(addr->sun_path) - 1); fd = socket(AF_UNIX, SOCK_STREAM, 0); if (fd < 0) { -- 2.25.1