mirror of https://gerrit.osmocom.org/libosmocore
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
This commit is contained in:
parent
3edd70c1f1
commit
6a90c723fb
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue