[CRIU] [PATCH] Don't use strlcpy in libcriu (v2)

Andrey Vagin avagin at openvz.org
Fri Oct 9 01:11:33 PDT 2015


From: Andrew Vagin <avagin at openvz.org>

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

v2: don't include string.h

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 | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/lib/criu.c b/lib/criu.c
index b53ea38..1f8c917 100644
--- a/lib/criu.c
+++ b/lib/criu.c
@@ -13,7 +13,6 @@
 #include <alloca.h>
 
 #include "criu.h"
-#include "string.h"
 #include "rpc.pb-c.h"
 #include "cr-service-const.h"
 
@@ -882,9 +881,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