[CRIU] [PATCH] Don't use strlcpy in libcriu

Andrey Vagin avagin at openvz.org
Thu Oct 8 13:33:40 PDT 2015


From: Andrew Vagin <avagin at openvz.org>

../../lib/libcriu.so: undefined reference to `strlcpy'

Reported-by: Mr Jenkins
Cc: Kir Kolyshkin <kir at openvz.org>
Fixes: e5654e586cf5 ("Use strlcpy")
Signed-off-by: Andrew Vagin <avagin at openvz.org>
---
 lib/criu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/criu.c b/lib/criu.c
index b53ea38..537304d 100644
--- a/lib/criu.c
+++ b/lib/criu.c
@@ -882,9 +882,9 @@ static int criu_connect(criu_opts *opts)
 	memset(&addr, 0, sizeof(addr));
 	addr.sun_family = AF_LOCAL;
 
-	strlcpy(addr.sun_path, opts->service_address, sizeof(addr.sun_path));
+	strncpy(addr.sun_path, opts->service_address, sizeof(addr.sun_path));
 
-	addr_len = strlen(addr.sun_path) + sizeof(addr.sun_family);
+	addr_len = strlen(opts->service_address) + sizeof(addr.sun_family);
 
 	ret = connect(fd, (struct sockaddr *) &addr, addr_len);
 	if (ret < 0) {
-- 
2.4.3



More information about the CRIU mailing list