From: Oliver Kurth Date: Wed, 30 Oct 2019 18:18:22 +0000 (-0700) Subject: Correct several uninitialied varialbles reported by Coverity in dnd/cp code. X-Git-Tag: stable-11.1.0~180 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c374b22454295785ba0ec0a3a8c5bf8d85a4cb02;p=thirdparty%2Fopen-vm-tools.git Correct several uninitialied varialbles reported by Coverity in dnd/cp code. - 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 --- diff --git a/open-vm-tools/services/plugins/dndcp/copyPasteDnDX11.cpp b/open-vm-tools/services/plugins/dndcp/copyPasteDnDX11.cpp index 893bda7a6..739db5a24 100644 --- a/open-vm-tools/services/plugins/dndcp/copyPasteDnDX11.cpp +++ b/open-vm-tools/services/plugins/dndcp/copyPasteDnDX11.cpp @@ -194,6 +194,7 @@ BlockService::Shutdown() */ CopyPasteDnDX11::CopyPasteDnDX11() : + m_main(NULL), m_copyPasteUI(NULL), m_dndUI(NULL) { diff --git a/open-vm-tools/services/plugins/dndcp/dndGuest/dndCPTransportGuestRpc.cpp b/open-vm-tools/services/plugins/dndcp/dndGuest/dndCPTransportGuestRpc.cpp index eea9e21d9..90e63761b 100644 --- a/open-vm-tools/services/plugins/dndcp/dndGuest/dndCPTransportGuestRpc.cpp +++ b/open-vm-tools/services/plugins/dndcp/dndGuest/dndCPTransportGuestRpc.cpp @@ -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 } } diff --git a/open-vm-tools/services/plugins/dndcp/dndGuest/guestCopyPasteDest.cc b/open-vm-tools/services/plugins/dndcp/dndGuest/guestCopyPasteDest.cc index 260399af3..918fdb37a 100644 --- a/open-vm-tools/services/plugins/dndcp/dndGuest/guestCopyPasteDest.cc +++ b/open-vm-tools/services/plugins/dndcp/dndGuest/guestCopyPasteDest.cc @@ -39,7 +39,8 @@ extern "C" { */ GuestCopyPasteDest::GuestCopyPasteDest(GuestCopyPasteMgr *mgr) - : mMgr(mgr) + : mMgr(mgr), + mIsActive(false) { ASSERT(mMgr); } diff --git a/open-vm-tools/services/plugins/dndcp/dndGuest/rpcV3Util.cpp b/open-vm-tools/services/plugins/dndcp/dndGuest/rpcV3Util.cpp index 8cc9c480a..655bf41de 100644 --- a/open-vm-tools/services/plugins/dndcp/dndGuest/rpcV3Util.cpp +++ b/open-vm-tools/services/plugins/dndcp/dndGuest/rpcV3Util.cpp @@ -53,7 +53,8 @@ extern "C" { */ RpcV3Util::RpcV3Util(void) - : mVersionMajor(3), + : mRpc(NULL), + mVersionMajor(3), mVersionMinor(0), mSeqNum(1) { diff --git a/open-vm-tools/services/plugins/dndcp/dndGuest/rpcV4Util.cpp b/open-vm-tools/services/plugins/dndcp/dndGuest/rpcV4Util.cpp index 29ef1007d..bb3149371 100644 --- a/open-vm-tools/services/plugins/dndcp/dndGuest/rpcV4Util.cpp +++ b/open-vm-tools/services/plugins/dndcp/dndGuest/rpcV4Util.cpp @@ -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); diff --git a/open-vm-tools/services/plugins/dndcp/dndGuest/vmGuestDnDCPMgr.hh b/open-vm-tools/services/plugins/dndcp/dndGuest/vmGuestDnDCPMgr.hh index d06a61a5e..05bd89156 100644 --- a/open-vm-tools/services/plugins/dndcp/dndGuest/vmGuestDnDCPMgr.hh +++ b/open-vm-tools/services/plugins/dndcp/dndGuest/vmGuestDnDCPMgr.hh @@ -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); diff --git a/open-vm-tools/services/plugins/dndcp/dndGuestBase/guestDnDSrc.cc b/open-vm-tools/services/plugins/dndcp/dndGuestBase/guestDnDSrc.cc index e85dc9d02..60092300b 100644 --- a/open-vm-tools/services/plugins/dndcp/dndGuestBase/guestDnDSrc.cc +++ b/open-vm-tools/services/plugins/dndcp/dndGuestBase/guestDnDSrc.cc @@ -42,7 +42,8 @@ extern "C" { */ GuestDnDSrc::GuestDnDSrc(GuestDnDMgr *mgr) - : mMgr(mgr) + : mMgr(mgr), + mRpc(NULL) { ASSERT(mMgr); mMgr->GetRpc()->srcDropChanged.connect( diff --git a/open-vm-tools/services/plugins/dndcp/dndUIX11.cpp b/open-vm-tools/services/plugins/dndcp/dndUIX11.cpp index 8eb7f826c..1a3b8d00a 100644 --- a/open-vm-tools/services/plugins/dndcp/dndUIX11.cpp +++ b/open-vm-tools/services/plugins/dndcp/dndUIX11.cpp @@ -83,6 +83,7 @@ DnDUIX11::DnDUIX11(ToolsAppCtx *ctx) mBlockAdded(false), mGHDnDInProgress(false), mGHDnDDataReceived(false), + mGHDnDDropOccurred(false), mUnityMode(false), mInHGDrag(false), mEffect(DROP_NONE),