diff options
author | Philipp Maier <pmaier@sysmocom.de> | 2020-04-20 11:08:29 +0200 |
---|---|---|
committer | dexter <pmaier@sysmocom.de> | 2020-05-12 11:03:51 +0000 |
commit | 6a90c723fb413d15d2ef005d463e96748480bf45 (patch) | |
tree | 2ce8738cdc2ded4c6d2f6b79cca0435f772e145e /src | |
parent | 3edd70c1f1cf1238f30e4d63866c9462be92441f (diff) |
exec: osmo_system_nowait2: initalize *pw pointer with NULL
The pointer *pw is only populated when the the parameter *user is given,
otherwise it remains uninitalized while it is used later when the
previleges are being dropped.
Change-Id: Idec7041e9ea17a252aefbf6fa90091ae17fd4fcd
Fixes: CID#209895
Diffstat (limited to 'src')
-rw-r--r-- | src/exec.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -211,7 +211,8 @@ extern char **environ; */ int osmo_system_nowait2(const char *command, const char **env_whitelist, char **addl_env, const char *user) { - struct passwd _pw, *pw; + struct passwd _pw; + struct passwd *pw = NULL; int getpw_buflen = sysconf(_SC_GETPW_R_SIZE_MAX); int rc; |