LOG(4, ("Error %d occurred parsing the packet\n", (uint32)status));
HgfsServerCompleteRequest(status, 0, input);
}
+
+ /*
+ * Storage pointed at by the variable input was freed either by
+ * HgfsServerProcessRequest at the end of request processing
+ * or by HgfsServerCompleteRequest if there was a protocol error.
+ */
+ /* coverity[leaked_storage] */
}
int exeLen;
char exeRealPath[1024];
+ /*
+ * This readlink() call on the "exe" file of the current /proc
+ * entry is not intended as a check on the subsequent open() of
+ * the "status" file of that entry, hence no time-of-check to
+ * time-of-use issue.
+ */
+ /* coverity[fs_check_call] */
exeLen = readlink(cmdFilePath, exeRealPath, sizeof exeRealPath -1);
if (exeLen != -1) {
exeRealPath[exeLen] = '\0';
* stat() /proc/<pid> to get the owner. We use fileStat.st_uid
* later in this code. If we can't stat(), ignore and continue.
* Maybe we don't have enough permission.
+ *
+ * This stat() call on the current /proc entry is not intended
+ * as a check on the open() near the top of the while loop which
+ * is on the cmdline file of the next entry in /proc, hence no
+ * time-of-check to time-of-use issue.
*/
+ /* coverity[fs_check_call] */
statResult = stat(cmdFilePath, &fileStat);
if (0 != statResult) {
goto next_entry;
if (!xdrProc(&xdrs, copy.result, 0)) {
ret = RPCIN_SETRETVALS(data, "XDR serialization failed.", FALSE);
+
+ /*
+ * DynXdr_Destroy only tries to free storage returned by a call to
+ * DynXdr_Create(NULL).
+ */
+ /* coverity[address_free] */
DynXdr_Destroy(&xdrs, TRUE);
goto exit;
}
data->result = DynXdr_Get(&xdrs);
data->resultLen = XDR_GETPOS(&xdrs);
data->freeResult = TRUE;
+
+ /*
+ * DynXdr_Destroy only tries to free storage returned by a call to
+ * DynXdr_Create(NULL).
+ */
+ /* coverity[address_free] */
DynXdr_Destroy(&xdrs, FALSE);
}
ret = TRUE;
exit:
+
+ /*
+ * DynXdr_Destroy only tries to free storage returned by a call to
+ * DynXdr_Create(NULL).
+ */
+ /* coverity[address_free] */
DynXdr_Destroy(&xdrs, !ret);
return ret;
}
}
ret = RpcChannel_SendOneRaw(DynXdr_Get(&xdrs), xdr_getpos(&xdrs),
reply, replySize);
+
+ /*
+ * DynXdr_Destroy only tries to free storage returned by a call to
+ * DynXdr_Create(NULL).
+ */
+ /* coverity[address_free] */
DynXdr_Destroy(&xdrs, TRUE);
return ret;
}
}
vm_free(reply);
}
+
+ /*
+ * DynXdr_Destroy only tries to free storage returned by a call to
+ * DynXdr_Create(NULL).
+ */
+ /* coverity[address_free] */
DynXdr_Destroy(&xdrs, TRUE);
exit:
}
ToolsCmd_FreeRPC(reply);
}
+
+ /*
+ * DynXdr_Destroy only tries to free storage returned by a call to
+ * DynXdr_Create(NULL).
+ */
+ /* coverity[address_free] */
DynXdr_Destroy(&xdrs, TRUE);
exit:
*fileSize = 0;
*contents = NULL;
+
+ /*
+ * No time-of-check to time-of-use issue between this lstat() call and the
+ * subsequent open() since the open() is followed by fstat() and a series
+ * of checks of the fstat results against the lstat results to ensure that
+ * key file attributes did not change between the lstat() and the open().
+ */
+ /* coverity[fs_check_call] */
ret = g_lstat(fileName, &lstatBuf);
if (ret != 0) {
Warning("%s: lstat(%s) failed (%d %d)\n",