summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Golle2020-07-12 16:36:05 +0000
committerDaniel Golle2020-07-13 11:14:49 +0000
commit9d0f83183400be105bd3cd8b9530d6eb9d678e0d (patch)
tree301d1e229c5e104a124fb4488eebb9364638dc4a
parentaed7fb3cf28021f555e938fa1226072db745ea22 (diff)
downloadprocd-9d0f83183400be105bd3cd8b9530d6eb9d678e0d.tar.gz
jail: fix segfault with len(uidmap/gidmap) > 1
Allocate enough memory for all uidmap/gidmap entries. Fixes: ea7a790 ("jail: add support for running OCI bundle") Signed-off-by: Daniel Golle <daniel@makrotopia.org>
-rw-r--r--jail/jail.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/jail/jail.c b/jail/jail.c
index 8a2d890..aa9285c 100644
--- a/jail/jail.c
+++ b/jail/jail.c
@@ -1105,7 +1105,7 @@ static int parseOCIuidgidmappings(struct blob_attr *msg, bool is_gidmap)
}
/* allocate combined mapping string */
- map = calloc(1 + len, sizeof(char));
+ map = calloc(1 + totallen, sizeof(char));
if (!map)
return ENOMEM;