From fd183797bc527a160958a5dee6b5af35646ccc6b Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Thu, 28 Jan 2021 23:46:16 +0000 Subject: [PATCH] jail: cgroups: fix uninitialized variable Make sure 'limit' is initialized to -1 (==max) when translating cgroups-1 memory controller spec to cgroups-2. Signed-off-by: Daniel Golle --- jail/cgroups.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jail/cgroups.c b/jail/cgroups.c index fc2bbeb..68bd189 100644 --- a/jail/cgroups.c +++ b/jail/cgroups.c @@ -644,7 +644,7 @@ static int parseOCIlinuxcgroups_legacy_memory(struct blob_attr *msg) { struct blob_attr *tb[__OCI_LINUX_CGROUPS_MEMORY_MAX]; char tmp[32] = { 0 }; - int64_t limit, swap, reservation; + int64_t limit = -1, swap, reservation; blobmsg_parse(oci_linux_cgroups_memory_policy, __OCI_LINUX_CGROUPS_MEMORY_MAX, tb, blobmsg_data(msg), blobmsg_len(msg)); -- 2.30.2