]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Address Coverity reported issues in the DnD plugin.
authorOliver Kurth <okurth@vmware.com>
Tue, 12 Nov 2019 02:12:22 +0000 (18:12 -0800)
committerOliver Kurth <okurth@vmware.com>
Tue, 12 Nov 2019 02:12:22 +0000 (18:12 -0800)
  - uninitialized non-static class members.
  - memory leak.
  - potential NULL pointer dereference.

open-vm-tools/services/plugins/dndcp/dndGuest/rpcV4Util.cpp
open-vm-tools/services/plugins/dndcp/dndGuestBase/dndUIX11.h
open-vm-tools/services/plugins/dndcp/dndUIX11.cpp

index bb31493712678aaf4f85a8043312978f1374b8a7..12ab4ecc5f5a89ad9bcae4daccdbe9fac0cd7e86 100644 (file)
@@ -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)
 {
index 8740e1750306c8a55eb86ca8b1986ee5788c47b3..0f70069997b174ce679f3e857aac78d9be91c635 100644 (file)
@@ -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. */
index 70074384257c5f98b23a05b1281b05175b1a88fd..e56a6f1f0ab1d2e8ef2810d87329f70e74bd6f1b 100644 (file)
@@ -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();