]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Correct several uninitialied varialbles reported by Coverity in dnd/cp code.
authorOliver Kurth <okurth@vmware.com>
Wed, 30 Oct 2019 18:18:22 +0000 (11:18 -0700)
committerOliver Kurth <okurth@vmware.com>
Wed, 30 Oct 2019 18:18:22 +0000 (11:18 -0700)
- uninit_member: Non-static class member mRpc is not initialized in this
  constructor nor in any functions that it calls.
 File: bora/lib/dnd/rpcutil/rpcV3Util.cpp
 Function: RpcV3Util

- uninit_member: Non-static class member field mRpcChanCBList.xdrInSize is
  not initialized in this constructor nor in any functions that it calls.
 File: bora/vmx/tools/dndCPTransportGuestRpc.cpp
 Function: DnDCPTransportGuestRpc

- uninit_member: Non-static class member mGHDnDDropOccurred is not initialized
  in this constructor nor in any functions that it calls.
 File: bora-vmsoft/lib/dndGuestBase/dndUIX11.cpp
 Function: DnDUIX11

- uninit_member: Non-static class member m_main is not initialized in this
  constructor nor in any functions that it calls.
 File: bora-vmsoft/services/plugins/dndcp/copyPasteDnDX11.cpp
 Function: CopyPasteDnDX11

- uninit_member: Non-static class member mToolsAppCtx is not initialized in
  this constructor nor in any functions that it calls.
 File: bora-vmsoft/lib/dndGuest/vmGuestDnDCPMgr.hh
 Function: VMGuestDnDCPMgr

- uninit_member: Non-static class member mRpc is not initialized in this
  constructor nor in any functions that it calls.
 File: bora-vmsoft/lib/dndGuestBase/guestDnDSrc.cc
 Function: GuestDnDSrc

- uninit_member: Non-static class member mMsgSrc is not initialized in this
  constructor nor in any functions that it calls.
 File: bora/lib/dnd/rpcutil/rpcV4Util.cpp
 Function: RpcV4Util

- uninit_member: Non-static class member mIsActive is not initialized in this
  constructor nor in any functions that it calls.
 File: bora-vmsoft/lib/dndGuest/guestCopyPasteDest.cc
 Function: GuestCopyPasteDest

open-vm-tools/services/plugins/dndcp/copyPasteDnDX11.cpp
open-vm-tools/services/plugins/dndcp/dndGuest/dndCPTransportGuestRpc.cpp
open-vm-tools/services/plugins/dndcp/dndGuest/guestCopyPasteDest.cc
open-vm-tools/services/plugins/dndcp/dndGuest/rpcV3Util.cpp
open-vm-tools/services/plugins/dndcp/dndGuest/rpcV4Util.cpp
open-vm-tools/services/plugins/dndcp/dndGuest/vmGuestDnDCPMgr.hh
open-vm-tools/services/plugins/dndcp/dndGuestBase/guestDnDSrc.cc
open-vm-tools/services/plugins/dndcp/dndUIX11.cpp

index 893bda7a6161586f4558c1cde677c6c3e2931d50..739db5a24e477642a34fa938442e93de89534b6c 100644 (file)
@@ -194,6 +194,7 @@ BlockService::Shutdown()
  */
 
 CopyPasteDnDX11::CopyPasteDnDX11() :
+   m_main(NULL),
    m_copyPasteUI(NULL),
    m_dndUI(NULL)
 {
index eea9e21d90de6087e41a255a7b235c57a0a8952a..90e63761b6fa98ff691c084b801d81133ebd99b1 100644 (file)
@@ -263,6 +263,9 @@ DnDCPTransportGuestRpc::DnDCPTransportGuestRpc(void)
    for (int i = 0; i < TRANSPORT_INTERFACE_MAX; i++) {
       mCBCtx[i].transport = this;
       mCBCtx[i].type = (TransportInterfaceType)i;
+#ifdef VMX86_TOOLS
+      mRpcChanCBList[i].xdrInSize = 0;
+#endif
    }
 }
 
index 260399af31b8c2053577848dccf40bcd4b9b3b55..918fdb37a6dfa269d9901638246ad1f4b5ed5272 100644 (file)
@@ -39,7 +39,8 @@ extern "C" {
  */
 
 GuestCopyPasteDest::GuestCopyPasteDest(GuestCopyPasteMgr *mgr)
- : mMgr(mgr)
+ : mMgr(mgr),
+   mIsActive(false)
 {
    ASSERT(mMgr);
 }
index 8cc9c480aff9c419fd4c9cff5f31e5c4e918f592..655bf41de5b15e93d5fb43c9b7565a9e70fb12d4 100644 (file)
@@ -53,7 +53,8 @@ extern "C" {
  */
 
 RpcV3Util::RpcV3Util(void)
-   : mVersionMajor(3),
+   : mRpc(NULL),
+     mVersionMajor(3),
      mVersionMinor(0),
      mSeqNum(1)
 {
index 29ef1007d096c373d570d7c345e8b6ce52c0b591..bb31493712678aaf4f85a8043312978f1374b8a7 100644 (file)
@@ -54,6 +54,7 @@ extern "C" {
 RpcV4Util::RpcV4Util(void)
    : mVersionMajor(4),
      mVersionMinor(0),
+     mMsgSrc(0),
      mMaxTransportPacketPayloadSize(DND_CP_PACKET_MAX_PAYLOAD_SIZE_V4)
 {
    DnDCPMsgV4_Init(&mBigMsgIn);
index d06a61a5ed155b1c69c858b8ffb409ddc4484ef9..05bd89156b24d8eff86db4e8ef72bc3fa7f7af09 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * Copyright (C) 2018 VMware, Inc. All rights reserved.
+ * Copyright (C) 2018-2019 VMware, Inc. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published
@@ -45,7 +45,7 @@ public:
    static VMGuestDnDCPMgr *CreateInstance(void);
 
 private:
-   VMGuestDnDCPMgr(void) : GuestDnDCPMgr() { }
+   VMGuestDnDCPMgr(void) : GuestDnDCPMgr(), mToolsAppCtx(NULL) { }
    VMGuestDnDCPMgr(const VMGuestDnDCPMgr &mgr);
    VMGuestDnDCPMgr& operator=(const VMGuestDnDCPMgr &mgr);
 
index e85dc9d02319782d1e3ea8c1466911e2220a7e79..60092300b13bfdb51e2e70b77320ff5dafff4e8f 100644 (file)
@@ -42,7 +42,8 @@ extern "C" {
  */
 
 GuestDnDSrc::GuestDnDSrc(GuestDnDMgr *mgr)
- : mMgr(mgr)
+ : mMgr(mgr),
+   mRpc(NULL)
 {
    ASSERT(mMgr);
    mMgr->GetRpc()->srcDropChanged.connect(
index 8eb7f826c24dd051649f4a0da021e2fb68bf7163..1a3b8d00a2574dadc8c3336e2ea303469ff3c782 100644 (file)
@@ -83,6 +83,7 @@ DnDUIX11::DnDUIX11(ToolsAppCtx *ctx)
       mBlockAdded(false),
       mGHDnDInProgress(false),
       mGHDnDDataReceived(false),
+      mGHDnDDropOccurred(false),
       mUnityMode(false),
       mInHGDrag(false),
       mEffect(DROP_NONE),