summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Golle2021-01-28 23:46:16 +0000
committerDaniel Golle2021-02-02 12:54:00 +0000
commitfd183797bc527a160958a5dee6b5af35646ccc6b (patch)
treecaa515213c2f82d0049652856f6144054a548ec1
parent0a74c067f9d1d17a82ac10ff2f86596a887a41aa (diff)
downloadprocd-fd183797bc527a160958a5dee6b5af35646ccc6b.tar.gz
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 <daniel@makrotopia.org>
-rw-r--r--jail/cgroups.c2
1 files changed, 1 insertions, 1 deletions
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));