autofs-5.1.9 - initialise process variables in log_pidinfo() From: Ian Kent Since the various pid variables will always be greater than 0 if found initialise them to that value in log_pidinfo(). Signed-off-by: Ian Kent --- CHANGELOG | 1 + lib/log.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 01a7ffb2c..2e223989c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -43,6 +43,7 @@ - make mnts_has_mounted_mounts() check submounts. - fix string length check in merge_options() - dont initialize hosts list in add_host(). +- initialise process variables in log_pidinfo(). 02/11/2023 autofs-5.1.9 - fix kernel mount status notification. diff --git a/lib/log.c b/lib/log.c index 1c5b3da79..92e2c7b7d 100644 --- a/lib/log.c +++ b/lib/log.c @@ -350,8 +350,8 @@ pid_t log_pidinfo(struct autofs_point *ap, pid_t pid, char *label) { char buf[PATH_MAX + 1] = ""; FILE *statfile; - pid_t tgid, ppid; - int uid, euid, gid, egid; + pid_t tgid = 0, ppid = 0; + int uid = 0, euid = 0, gid = 0, egid = 0; char comm[64] = ""; sprintf(buf, "/proc/%d/status", pid);