From: Oliver Kurth Date: Mon, 17 Jun 2019 18:41:37 +0000 (-0700) Subject: Fix 'Using uninitialized value' issue reported by Coverity. X-Git-Tag: stable-11.0.0~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f456a5938662175b914ffcb53c6284835476268f;p=thirdparty%2Fopen-vm-tools.git Fix 'Using uninitialized value' issue reported by Coverity. * In a error code path, 'exitCode' variable is used without any initialization. This issue was reported by the Coverity. Fixed it by initializing the 'exitCode' to -1. * While fixing this, moved the variables to the if block where they are acutally used. --- diff --git a/open-vm-tools/lib/procMgr/procMgrPosix.c b/open-vm-tools/lib/procMgr/procMgrPosix.c index e2cd0619f..2f7711bdb 100644 --- a/open-vm-tools/lib/procMgr/procMgrPosix.c +++ b/open-vm-tools/lib/procMgr/procMgrPosix.c @@ -1638,8 +1638,6 @@ ProcMgr_ExecAsync(char const *cmd, // IN: UTF-8 command line ProcMgr_AsyncProc *asyncProc = NULL; pid_t pid; int fds[2]; - Bool validExitCode = FALSE; - int exitCode; pid_t resultPid; int readFd, writeFd; @@ -1664,6 +1662,8 @@ ProcMgr_ExecAsync(char const *cmd, // IN: UTF-8 command line int i, maxfd; Bool status = TRUE; pid_t childPid = -1; + Bool validExitCode = FALSE; + int exitCode = -1; /* * Child