From: Oliver Kurth Date: Tue, 12 Nov 2019 02:12:22 +0000 (-0800) Subject: Address Coverity reported issues in the DnD plugin. X-Git-Tag: stable-11.1.0~165 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2b7a823ffa977b010aa5e5a3e1b353d9b4d927fa;p=thirdparty%2Fopen-vm-tools.git Address Coverity reported issues in the DnD plugin. - uninitialized non-static class members. - memory leak. - potential NULL pointer dereference. --- diff --git a/open-vm-tools/services/plugins/dndcp/dndGuest/rpcV4Util.cpp b/open-vm-tools/services/plugins/dndcp/dndGuest/rpcV4Util.cpp index bb3149371..12ab4ecc5 100644 --- a/open-vm-tools/services/plugins/dndcp/dndGuest/rpcV4Util.cpp +++ b/open-vm-tools/services/plugins/dndcp/dndGuest/rpcV4Util.cpp @@ -52,8 +52,10 @@ extern "C" { */ RpcV4Util::RpcV4Util(void) - : mVersionMajor(4), + : mRpc(NULL), + mVersionMajor(4), mVersionMinor(0), + mMsgType(0), mMsgSrc(0), mMaxTransportPacketPayloadSize(DND_CP_PACKET_MAX_PAYLOAD_SIZE_V4) { diff --git a/open-vm-tools/services/plugins/dndcp/dndGuestBase/dndUIX11.h b/open-vm-tools/services/plugins/dndcp/dndGuestBase/dndUIX11.h index 8740e1750..0f7006999 100644 --- a/open-vm-tools/services/plugins/dndcp/dndGuestBase/dndUIX11.h +++ b/open-vm-tools/services/plugins/dndcp/dndGuestBase/dndUIX11.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2009-2017 VMware, Inc. All rights reserved. + * Copyright (C) 2009-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 @@ -206,7 +206,6 @@ private: CPClipboard mClipboard; DnDBlockControl *mBlockCtrl; DND_FILE_TRANSFER_STATUS mHGGetFileStatus; - int mHGEffect; bool mBlockAdded; /* State to determine if drag motion is a drag enter. */ diff --git a/open-vm-tools/services/plugins/dndcp/dndUIX11.cpp b/open-vm-tools/services/plugins/dndcp/dndUIX11.cpp index 700743842..e56a6f1f0 100644 --- a/open-vm-tools/services/plugins/dndcp/dndUIX11.cpp +++ b/open-vm-tools/services/plugins/dndcp/dndUIX11.cpp @@ -78,6 +78,7 @@ DnDUIX11::DnDUIX11(ToolsAppCtx *ctx) : mCtx(ctx), mDnD(NULL), mDetWnd(NULL), + mClipboard(), mBlockCtrl(NULL), mHGGetFileStatus(DND_FILE_TRANSFER_NOT_STARTED), mBlockAdded(false), @@ -94,7 +95,9 @@ DnDUIX11::DnDUIX11(ToolsAppCtx *ctx) mDestDropTime(0), mTotalFileSize(0), mOrigin(0, 0), - mUseUInput(false) + mUseUInput(false), + mScreenWidth(0), + mScreenHeight(0) { TRACE_CALL();