From: Oliver Kurth Date: Fri, 22 Nov 2019 22:52:35 +0000 (-0800) Subject: Add Coverity annotations to bora/lib/file/file. X-Git-Tag: stable-11.1.0~131 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b74897122d4277c703e6af416dbcf48dab509e91;p=thirdparty%2Fopen-vm-tools.git Add Coverity annotations to bora/lib/file/file. Add annotations for Coverity-reported false positives in filePosix.c and fileIOPosix.c. --- diff --git a/open-vm-tools/lib/file/fileIOPosix.c b/open-vm-tools/lib/file/fileIOPosix.c index 4f259737d..32f6cec36 100644 --- a/open-vm-tools/lib/file/fileIOPosix.c +++ b/open-vm-tools/lib/file/fileIOPosix.c @@ -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); diff --git a/open-vm-tools/lib/file/filePosix.c b/open-vm-tools/lib/file/filePosix.c index d6b7f7704..84e0e51cb 100644 --- a/open-vm-tools/lib/file/filePosix.c +++ b/open-vm-tools/lib/file/filePosix.c @@ -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); }