mirror of
https://github.com/systemd/systemd.git
synced 2025-01-26 14:04:03 +03:00
namespace: fix uninitialized memory access
This commit is contained in:
parent
063e36db8a
commit
002b226843
Notes:
Lennart Poettering
2014-07-03 20:25:14 +02:00
Backport: bugfix
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user