chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
13be497
)
nspawn: Fix erroneous OOM when building group list
author
Philip Lorenz
<philip@bithub.de>
Wed, 9 Apr 2014 17:08:45 +0000
(19:08 +0200)
committer
Zbigniew Jędrzejewski-Szmek
<zbyszek@in.waw.pl>
Thu, 10 Apr 2014 13:50:39 +0000
(09:50 -0400)
change_uid_gid() never initialises sz which may cause greedy_realloc to
skip the initial buffer allocation.
src/nspawn/nspawn.c
patch
|
blob
|
history
diff --git
a/src/nspawn/nspawn.c
b/src/nspawn/nspawn.c
index 84724d59c9177cae9a16acafb70c4c24f8340525..0bd52da56843df40b31cd6227f4a6747491b6c8c 100644
(file)
--- a/
src/nspawn/nspawn.c
+++ b/
src/nspawn/nspawn.c
@@
-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;
_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;
uid_t uid;
gid_t gid;
pid_t pid;