Blame SOURCES/ovt-Fix-Using-uninitialized-value-issue-reported-by-Cove.patch

604589
From e94fc95c580ce75ccc34793ffb000d9765ebe3d3 Mon Sep 17 00:00:00 2001
604589
From: Cathy Avery <cavery@redhat.com>
604589
Date: Thu, 25 Jul 2019 12:32:36 +0200
604589
Subject: [PATCH 13/16] Fix 'Using uninitialized value' issue reported by
604589
 Coverity.
604589
604589
RH-Author: Cathy Avery <cavery@redhat.com>
604589
Message-id: <20190725123239.18274-14-cavery@redhat.com>
604589
Patchwork-id: 89714
604589
O-Subject: [RHEL8.1 open-vm-tools PATCH 13/16] Fix 'Using uninitialized value' issue reported by Coverity.
604589
Bugzilla: 1602648
604589
RH-Acked-by: Vitaly Kuznetsov <vkuznets@redhat.com>
604589
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
604589
604589
commit f456a5938662175b914ffcb53c6284835476268f
604589
Author: Oliver Kurth <okurth@vmware.com>
604589
Date:   Mon Jun 17 11:41:37 2019 -0700
604589
604589
    Fix 'Using uninitialized value' issue reported by Coverity.
604589
604589
    * In a error code path, 'exitCode' variable is used without
604589
      any initialization.  This issue was reported by the Coverity.
604589
      Fixed it by initializing the 'exitCode' to -1.
604589
604589
    * While fixing this, moved the variables to the if block where
604589
      they are acutally used.
604589
604589
Signed-off-by: Cathy Avery <cavery@redhat.com>
604589
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
604589
---
604589
 open-vm-tools/lib/procMgr/procMgrPosix.c | 4 ++--
604589
 1 file changed, 2 insertions(+), 2 deletions(-)
604589
604589
diff --git a/lib/procMgr/procMgrPosix.c b/lib/procMgr/procMgrPosix.c
604589
index 3ff98eb..fe26d42 100644
604589
--- a/lib/procMgr/procMgrPosix.c
604589
+++ b/lib/procMgr/procMgrPosix.c
604589
@@ -1582,8 +1582,6 @@ ProcMgr_ExecAsync(char const *cmd,                 // IN: UTF-8 command line
604589
    ProcMgr_AsyncProc *asyncProc = NULL;
604589
    pid_t pid;
604589
    int fds[2];
604589
-   Bool validExitCode = FALSE;
604589
-   int exitCode;
604589
    pid_t resultPid;
604589
    int readFd, writeFd;
604589
 
604589
@@ -1608,6 +1606,8 @@ ProcMgr_ExecAsync(char const *cmd,                 // IN: UTF-8 command line
604589
       int i, maxfd;
604589
       Bool status = TRUE;
604589
       pid_t childPid = -1;
604589
+      Bool validExitCode = FALSE;
604589
+      int exitCode = -1;
604589
 
604589
       /*
604589
        * Child
604589
-- 
604589
1.8.3.1
604589