summaryrefslogtreecommitdiff
path: root/src/core/namespace.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-07-03 16:27:53 +0200
committerLennart Poettering <lennart@poettering.net>2014-07-03 16:28:26 +0200
commit002b226843e77630128da580225f9c3ef8474db2 (patch)
tree60e794c86336d7493d9f18c57ed7ad7adc34f971 /src/core/namespace.c
parent063e36db8aed7b54100b33089deb6d2e86d516b9 (diff)
namespace: fix uninitialized memory access
Diffstat (limited to 'src/core/namespace.c')
-rw-r--r--src/core/namespace.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/namespace.c b/src/core/namespace.c
index d1513ce2dd..1d0f740afa 100644
--- a/src/core/namespace.c
+++ b/src/core/namespace.c
@@ -69,6 +69,7 @@ static int append_mounts(BindMount **p, char **strv, MountMode mode) {
STRV_FOREACH(i, strv) {
(*p)->ignore = false;
+ (*p)->done = false;
if ((mode == INACCESSIBLE || mode == READONLY || mode == READWRITE) && (*i)[0] == '-') {
(*p)->ignore = true;
@@ -375,7 +376,7 @@ int setup_namespace(
(protect_system == PROTECT_SYSTEM_FULL ? 1 : 0);
if (n > 0) {
- m = mounts = (BindMount *) alloca(n * sizeof(BindMount));
+ m = mounts = (BindMount *) alloca0(n * sizeof(BindMount));
r = append_mounts(&m, read_write_dirs, READWRITE);
if (r < 0)
return r;