Blame SOURCES/ovt-Address-two-Coverity-reported-issues-in-hostinfoPosi.patch

afff29
From 805d013a5604b124177149be4d10384f58eff74b Mon Sep 17 00:00:00 2001
afff29
From: Cathy Avery <cavery@redhat.com>
afff29
Date: Tue, 3 Dec 2019 14:30:49 +0100
afff29
Subject: [PATCH 3/4] Address two Coverity-reported issues in hostinfoPosix.c.
afff29
afff29
RH-Author: Cathy Avery <cavery@redhat.com>
afff29
Message-id: <20191203143050.23065-4-cavery@redhat.com>
afff29
Patchwork-id: 92834
afff29
O-Subject: [RHEL8.2 open-vm-tools PATCH 3/4] Address two Coverity-reported issues in hostinfoPosix.c.
afff29
Bugzilla: 1769881
afff29
RH-Acked-by: Vitaly Kuznetsov <vkuznets@redhat.com>
afff29
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
afff29
afff29
commit 8a01c912927b5bb8cdbfa57f5e8c92e8cf792bef
afff29
Author: Oliver Kurth <okurth@vmware.com>
afff29
Date:   Fri Nov 22 14:52:35 2019 -0800
afff29
afff29
    Address two Coverity-reported issues in hostinfoPosix.c.
afff29
afff29
    Rework some code with the intent of making it more straightfoward,
afff29
    which also eliminates a false positive.
afff29
afff29
    Check the return value from PosixUnlink and log a warning on error.
afff29
afff29
Signed-off-by: Cathy Avery <cavery@redhat.com>
afff29
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
afff29
---
afff29
 open-vm-tools/lib/misc/hostinfoPosix.c | 10 +++++-----
afff29
 1 file changed, 5 insertions(+), 5 deletions(-)
afff29
afff29
diff --git a/open-vm-tools/lib/misc/hostinfoPosix.c b/open-vm-tools/lib/misc/hostinfoPosix.c
afff29
index 348a67e..302452e 100644
afff29
--- a/open-vm-tools/lib/misc/hostinfoPosix.c
afff29
+++ b/open-vm-tools/lib/misc/hostinfoPosix.c
afff29
@@ -1127,10 +1127,7 @@ out:
afff29
    if (success) {
afff29
       result[nArgs - 1] = DynBuf_Detach(&b);
afff29
    } else {
afff29
-      if (nArgs != 0) {
afff29
-         Util_FreeStringList(result, nArgs);
afff29
-      }
afff29
-
afff29
+      Util_FreeStringList(result, nArgs);
afff29
       result = NULL;
afff29
    }
afff29
 
afff29
@@ -2884,7 +2881,10 @@ Hostinfo_Daemonize(const char *path,             // IN: NUL-terminated UTF-8
afff29
           * with another process attempting to daemonize and unlinking the
afff29
           * file it created instead.
afff29
           */
afff29
-         Posix_Unlink(pidPath);
afff29
+         if (Posix_Unlink(pidPath) != 0) {
afff29
+            Warning("%s: Unable to unlink %s: %u\n",
afff29
+                    __FUNCTION__, pidPath, errno);
afff29
+         }
afff29
       }
afff29
 
afff29
       errno = err;
afff29
-- 
afff29
1.8.3.1
afff29