aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2020-04-20 11:08:29 +0200
committerdexter <pmaier@sysmocom.de>2020-05-12 11:03:51 +0000
commit6a90c723fb413d15d2ef005d463e96748480bf45 (patch)
tree2ce8738cdc2ded4c6d2f6b79cca0435f772e145e
parent3edd70c1f1cf1238f30e4d63866c9462be92441f (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
-rw-r--r--src/exec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/exec.c b/src/exec.c
index 578e2b11..2a03ba80 100644
--- a/src/exec.c
+++ b/src/exec.c
@@ -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;