Blame SOURCES/0002-Address-Coverity-issues-reported-in-bora-lib-file-fi.patch

3857c4
From e1d523d4fdb179e3fd2494d18e813a4e392006e5 Mon Sep 17 00:00:00 2001
d75d53
From: Cathy Avery <cavery@redhat.com>
d75d53
Date: Tue, 3 Dec 2019 14:30:47 +0100
3857c4
Subject: Address Coverity issues reported in bora/lib/file/file.c.
d75d53
d75d53
RH-Author: Cathy Avery <cavery@redhat.com>
d75d53
Message-id: <20191203143050.23065-2-cavery@redhat.com>
d75d53
Patchwork-id: 92833
d75d53
O-Subject: [RHEL8.2 open-vm-tools PATCH 1/4] Address Coverity issues reported in bora/lib/file/file.c.
d75d53
Bugzilla: 1769881
d75d53
RH-Acked-by: Vitaly Kuznetsov <vkuznets@redhat.com>
d75d53
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
d75d53
d75d53
commit 5ca2850b60de0f27c3f8c565d7b7e553acc2921f
d75d53
Author: Oliver Kurth <okurth@vmware.com>
d75d53
Date:   Tue Aug 27 12:55:37 2019 -0700
d75d53
d75d53
    Address Coverity issues reported in bora/lib/file/file.c.
d75d53
d75d53
    Fix a minor memory leak in the function File_ExpandAndCheckDir.
d75d53
    Also add annotations for unchecked return values in functions
d75d53
    GetOldMachineID and File_MoveTree, so that Coverity scans of
d75d53
    open-vm-tools will automatically classify these issues as
d75d53
    "Intentional".  These annotations are useful both for internal
d75d53
    use as well as for partners who run Coverity scans on open-vm-tools.
d75d53
d75d53
Signed-off-by: Cathy Avery <cavery@redhat.com>
d75d53
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
d75d53
---
d75d53
 open-vm-tools/lib/file/file.c | 3 +++
d75d53
 1 file changed, 3 insertions(+)
d75d53
d75d53
diff --git a/open-vm-tools/lib/file/file.c b/open-vm-tools/lib/file/file.c
d75d53
index 7dae12c..774ec41 100644
d75d53
--- a/open-vm-tools/lib/file/file.c
d75d53
+++ b/open-vm-tools/lib/file/file.c
d75d53
@@ -558,6 +558,7 @@ GetOldMachineID(void)
d75d53
              sizeof hardwareID);
d75d53
 
d75d53
       /* Base 64 encode the binary data to obtain printable characters */
d75d53
+      /* coverity[check_return] */
d75d53
       Base64_Encode(rawMachineID, sizeof rawMachineID, encodedMachineID,
d75d53
                     sizeof encodedMachineID, NULL);
d75d53
 
d75d53
@@ -1437,6 +1438,7 @@ File_MoveTree(const char *srcName,    // IN:
d75d53
              * Only clean up if we created the directory.  Not attempting to
d75d53
              * clean up partial failures.
d75d53
              */
d75d53
+            /* coverity[check_return] */
d75d53
             File_DeleteDirectoryTree(dstName);
d75d53
          }
d75d53
       }
d75d53
@@ -2186,6 +2188,7 @@ File_ExpandAndCheckDir(const char *dirName)  // IN:
d75d53
 
d75d53
          return edirName;
d75d53
       }
d75d53
+      free(edirName);
d75d53
    }
d75d53
 
d75d53
    return NULL;
d75d53
-- 
d75d53
1.8.3.1
d75d53