Change in libosmocore[master]: exec: osmo_system_nowait2: initalize *pw pointer with NULL

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

dexter gerrit-no-reply at lists.osmocom.org
Mon Apr 20 09:15:35 UTC 2020


dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/17884 )


Change subject: exec: osmo_system_nowait2: initalize *pw pointer with NULL
......................................................................

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
---
M src/exec.c
1 file changed, 2 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/84/17884/1

diff --git a/src/exec.c b/src/exec.c
index 578e2b1..2a03ba8 100644
--- a/src/exec.c
+++ b/src/exec.c
@@ -211,7 +211,8 @@
  */
 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;
 

-- 
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/17884
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Idec7041e9ea17a252aefbf6fa90091ae17fd4fcd
Gerrit-Change-Number: 17884
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200420/92861ebf/attachment.htm>


More information about the gerrit-log mailing list