]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Add Coverity annotations to bora/lib/file/file.
authorOliver Kurth <okurth@vmware.com>
Fri, 22 Nov 2019 22:52:35 +0000 (14:52 -0800)
committerOliver Kurth <okurth@vmware.com>
Fri, 22 Nov 2019 22:52:35 +0000 (14:52 -0800)
Add annotations for Coverity-reported false positives in filePosix.c
and fileIOPosix.c.

open-vm-tools/lib/file/fileIOPosix.c
open-vm-tools/lib/file/filePosix.c

index 4f259737d3a04b83ab514ba15de07a910f599dd5..32f6cec362a444f69f46817bec4289821c167272 100644 (file)
@@ -2058,6 +2058,12 @@ FileIOPreadvInternal(
       ssize_t retval = 0;
 
       ASSERT(numVec > 0);
+
+      /*
+       * This is needed to deal with old libraries.  Once we're over
+       * the library horizon this can go away.
+       */
+      /* coverity[func_conv] */
       if (preadv64 == NULL) {
          fret = FileIOPreadvCoalesced(fd, entries, numEntries, offset,
                                       totalSize, &bytesRead);
@@ -2193,6 +2199,12 @@ FileIOPwritevInternal(
       ssize_t retval = 0;
 
       ASSERT(numVec > 0);
+
+      /*
+       * This is needed to deal with old libraries.  Once we're over
+       * the library horizon this can go away.
+       */
+      /* coverity[func_conv] */
       if (pwritev64 == NULL) {
          fret = FileIOPwritevCoalesced(fd, entries, numEntries, offset,
                                        totalSize, &bytesWritten);
index d6b7f770461144775267071171d4f7f824ce0db8..84e0e51cbbaae6799aa20e1c9b50a326bee818b0 100644 (file)
@@ -1964,6 +1964,13 @@ retry:
                   Str_Strcpy(canPath, ptr, sizeof canPath);
                }
             } else {
+
+               /*
+                * This is coded as it is in order to document clearly that
+                * the function does not handle bind mount correctly (it
+                * always assumes rbind).
+                */
+               /* coverity[dead_error_line] */
                Str_Strcpy(canPath, ptr, sizeof canPath);
             }