[lxc-devel] [lxc/master] confile: fix heap overflow issue

2xsec on Github lxc-bot at linuxcontainers.org
Wed Oct 17 10:35:56 UTC 2018


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 1217 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20181017/04389ea0/attachment.bin>
-------------- next part --------------
From 44f54dee4c79b2a49a6fb26962e49fe17d9a1b13 Mon Sep 17 00:00:00 2001
From: 2xsec <dh48.jeong at samsung.com>
Date: Wed, 17 Oct 2018 19:29:42 +0900
Subject: [PATCH] confile: fix heap overflow issue

Signed-off-by: 2xsec <dh48.jeong at samsung.com>
---
 src/lxc/confile.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lxc/confile.c b/src/lxc/confile.c
index af7be1501..6e83d2851 100644
--- a/src/lxc/confile.c
+++ b/src/lxc/confile.c
@@ -2048,8 +2048,8 @@ int append_unexp_config_line(const char *line, struct lxc_conf *conf)
 		if (!tmp)
 			return -1;
 
-		if (!conf->unexpanded_config)
-			*tmp = '\0';
+		memset(tmp + conf->unexpanded_alloced, 0, 1024);
+
 		conf->unexpanded_config = tmp;
 		conf->unexpanded_alloced += 1024;
 	}


More information about the lxc-devel mailing list