nspawn: Fix erroneous OOM when building group list

change_uid_gid() never initialises sz which may cause greedy_realloc to
skip the initial buffer allocation.
This commit is contained in:
Philip Lorenz
2014-04-10 09:50:39 -04:00
committed by Zbigniew Jędrzejewski-Szmek
parent 13be49798c
commit 70f539ca14
+1 -1
View File
@@ -2366,7 +2366,7 @@ static int change_uid_gid(char **_home) {
_cleanup_fclose_ FILE *f = NULL;
_cleanup_close_ int fd = -1;
unsigned n_uids = 0;
size_t sz, l;
size_t sz = 0, l;
uid_t uid;
gid_t gid;
pid_t pid;