The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxc/pull/2749

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
s/strlcpy/strncpy/g

Signed-off-by: Christian Brauner <christian.brau...@ubuntu.com>
From 2970e75408559d99ec3d5f5f393c9020a0698cb5 Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brau...@ubuntu.com>
Date: Tue, 11 Dec 2018 11:36:54 +0100
Subject: [PATCH] storage: src cannot be truncated

s/strlcpy/strncpy/g

Signed-off-by: Christian Brauner <christian.brau...@ubuntu.com>
---
 src/lxc/storage/storage_utils.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/src/lxc/storage/storage_utils.c b/src/lxc/storage/storage_utils.c
index fa4e7270bd..8bf55c52bd 100644
--- a/src/lxc/storage/storage_utils.c
+++ b/src/lxc/storage/storage_utils.c
@@ -95,14 +95,8 @@ char *dir_new_path(char *src, const char *oldname, const 
char *name,
        }
 
        while ((p2 = strstr(src, oldname)) != NULL) {
-               size_t retlen;
-
                /* copy text up to oldname */
-               retlen = strlcpy(p, src, p2 - src);
-               if (retlen >= p2 - src) {
-                       free(ret);
-                       return NULL;
-               }
+               strncpy(p, src, p2 - src);
 
                /* move target pointer (p) */
                p += p2 - src;
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to