[lxc-devel] [lxcfs/master] proc_fuse: ensure struct memory_stat is properly zeroed

brauner on Github lxc-bot at linuxcontainers.org
Thu Feb 27 16:09:43 UTC 2020


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 365 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20200227/647ab064/attachment.bin>
-------------- next part --------------
From 334a14f929ede1e3e6c10f474a923d4ec935176b Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brauner at ubuntu.com>
Date: Thu, 27 Feb 2020 17:07:29 +0100
Subject: [PATCH] proc_fuse: ensure struct memory_stat is properly zeroed

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>
---
 proc_fuse.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/proc_fuse.c b/proc_fuse.c
index 5688d83..6a14e90 100644
--- a/proc_fuse.c
+++ b/proc_fuse.c
@@ -1036,7 +1036,7 @@ static int proc_meminfo_read(char *buf, size_t size, off_t offset,
 	struct file_info *d = INTTYPE_TO_PTR(fi->fh);
 	uint64_t memlimit = 0, memusage = 0, memswlimit = 0, memswusage = 0,
 		 hosttotal = 0;
-	struct memory_stat mstat;
+	struct memory_stat mstat = {};
 	size_t linelen = 0, total_len = 0;
 	char *cache = d->buf;
 	size_t cache_size = d->buflen;


More information about the lxc-devel mailing list