From 485540bbb48a7877a457f125c6a8e0b5c97e4e47 Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Fri, 12 May 2017 00:10:16 +0100 Subject: [PATCH 01/21] #6037 socket accept() failure could lead to NULL ptr dereference --- src/lib/arch/win32/ArchNetworkWinsock.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/lib/arch/win32/ArchNetworkWinsock.cpp b/src/lib/arch/win32/ArchNetworkWinsock.cpp index 24310402..65a5b320 100644 --- a/src/lib/arch/win32/ArchNetworkWinsock.cpp +++ b/src/lib/arch/win32/ArchNetworkWinsock.cpp @@ -311,7 +311,7 @@ ArchNetworkWinsock::listenOnSocket(ArchSocket s) } ArchSocket -ArchNetworkWinsock::acceptSocket(ArchSocket s, ArchNetAddress* addr) +ArchNetworkWinsock::acceptSocket(ArchSocket s, ArchNetAddress* const addr) { assert(s != NULL); @@ -325,7 +325,9 @@ ArchNetworkWinsock::acceptSocket(ArchSocket s, ArchNetAddress* addr) int err = getsockerror_winsock(); delete socket; free(tmp); - *addr = NULL; + if (addr) { + *addr = NULL; + } if (err == WSAEWOULDBLOCK) { return NULL; } @@ -339,7 +341,9 @@ ArchNetworkWinsock::acceptSocket(ArchSocket s, ArchNetAddress* addr) close_winsock(fd); delete socket; free(tmp); - *addr = NULL; + if (addr) { + *addr = NULL; + } throw; } From 0290583ab99d1c3f0ca4821f9a69d993037b8722 Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Fri, 12 May 2017 00:20:59 +0100 Subject: [PATCH 02/21] #6037 Unitialized handles and other members in ArchTaskBarWindows --- src/lib/arch/win32/ArchTaskBarWindows.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/lib/arch/win32/ArchTaskBarWindows.cpp b/src/lib/arch/win32/ArchTaskBarWindows.cpp index 3ec3b21b..61376674 100644 --- a/src/lib/arch/win32/ArchTaskBarWindows.cpp +++ b/src/lib/arch/win32/ArchTaskBarWindows.cpp @@ -39,10 +39,14 @@ static const UINT kFirstReceiverID = WM_USER + 14; ArchTaskBarWindows* ArchTaskBarWindows::s_instance = NULL; ArchTaskBarWindows::ArchTaskBarWindows() : - m_nextID(kFirstReceiverID), - m_thread(NULL), + m_mutex(NULL), m_condVar(NULL), - m_mutex(NULL) + m_ready(false), + m_result(0), + m_thread(NULL), + m_hwnd(NULL), + m_taskBarRestart(0), + m_nextID(kFirstReceiverID) { // save the singleton instance s_instance = this; From 46231cd35cc4eec045a4524880cf8868e8fb01b6 Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Fri, 12 May 2017 00:45:59 +0100 Subject: [PATCH 03/21] #6037 Slightly improve error checking in vformat() --- src/lib/base/String.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/lib/base/String.cpp b/src/lib/base/String.cpp index e1da621f..8349715b 100644 --- a/src/lib/base/String.cpp +++ b/src/lib/base/String.cpp @@ -30,6 +30,7 @@ #include #include #include +#include namespace synergy { namespace string { @@ -50,8 +51,8 @@ vformat(const char* fmt, va_list args) // find highest indexed substitution and the locations of substitutions std::vector pos; std::vector width; - std::vector index; - int maxIndex = 0; + std::vector index; + size_t maxIndex = 0; for (const char* scan = fmt; *scan != '\0'; ++scan) { if (*scan == '%') { ++scan; @@ -61,21 +62,22 @@ vformat(const char* fmt, va_list args) else if (*scan == '%') { // literal index.push_back(0); - pos.push_back(static_cast(scan - 1 - fmt)); + pos.push_back(static_cast((scan - 1) - fmt)); width.push_back(2); } else if (*scan == '{') { // get argument index char* end; - int i = static_cast(strtol(scan + 1, &end, 10)); - if (*end != '}') { + errno = 0; + long i = strtol(scan + 1, &end, 10); + if (errno || (i < 0) || (*end != '}')) { // invalid index -- ignore - scan = end - 1; + scan = end - 1; // BUG if there are digits? } else { index.push_back(i); - pos.push_back(static_cast(scan - 1 - fmt)); - width.push_back(static_cast(end - scan + 2)); + pos.push_back(static_cast((scan - 1) - fmt)); + width.push_back(static_cast((end - scan) + 2)); if (i > maxIndex) { maxIndex = i; } From 7deb5f04f34be6f65deca43c4add23867d03b495 Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Fri, 12 May 2017 00:57:46 +0100 Subject: [PATCH 04/21] #6037 Replaced empty()->clear() mixup --- src/lib/ipc/IpcServer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/ipc/IpcServer.cpp b/src/lib/ipc/IpcServer.cpp index 390310ec..791595f2 100644 --- a/src/lib/ipc/IpcServer.cpp +++ b/src/lib/ipc/IpcServer.cpp @@ -80,7 +80,7 @@ IpcServer::~IpcServer() for (it = m_clients.begin(); it != m_clients.end(); it++) { deleteClient(*it); } - m_clients.empty(); + m_clients.clear(); ARCH->unlockMutex(m_clientsMutex); ARCH->closeMutex(m_clientsMutex); From 823868f767d834fce432cd957cff905907d2e4c6 Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Fri, 12 May 2017 01:07:57 +0100 Subject: [PATCH 05/21] #6037 Fix potential memory leak if SetClipboardData fails --- src/lib/platform/MSWindowsClipboard.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/platform/MSWindowsClipboard.cpp b/src/lib/platform/MSWindowsClipboard.cpp index 2373d255..5a807a0c 100644 --- a/src/lib/platform/MSWindowsClipboard.cpp +++ b/src/lib/platform/MSWindowsClipboard.cpp @@ -88,7 +88,11 @@ MSWindowsClipboard::empty() // mark clipboard as being owned by synergy HGLOBAL data = GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE, 1); - SetClipboardData(getOwnershipFormat(), data); + if (NULL == SetClipboardData(getOwnershipFormat(), data)) { + LOG((CLOG_DEBUG "failed to set clipboard data")); + GlobalFree(data); + return false; + } return true; } From 3e6b6dc7b8ae20133c6e5e77323bb6d7af4674e9 Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Fri, 12 May 2017 01:41:17 +0100 Subject: [PATCH 06/21] #6037 Remove crazy LoadString wrapper --- src/lib/platform/MSWindowsUtil.cpp | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/src/lib/platform/MSWindowsUtil.cpp b/src/lib/platform/MSWindowsUtil.cpp index 811c6be2..7ce6e2dc 100644 --- a/src/lib/platform/MSWindowsUtil.cpp +++ b/src/lib/platform/MSWindowsUtil.cpp @@ -29,31 +29,14 @@ String MSWindowsUtil::getString(HINSTANCE instance, DWORD id) { - char buffer[1024]; - int size = static_cast(sizeof(buffer) / sizeof(buffer[0])); - char* msg = buffer; + char* msg = NULL; + int n = LoadString(instance, id, reinterpret_cast(&msg), 0); - // load string - int n = LoadString(instance, id, msg, size); - msg[n] = '\0'; - if (n < size) { - return msg; + if (n <= 0) { + return String(); } - // not enough buffer space. keep trying larger buffers until - // we get the whole string. - msg = NULL; - do { - size <<= 1; - delete[] msg; - char* msg = new char[size]; - n = LoadString(instance, id, msg, size); - } while (n == size); - msg[n] = '\0'; - - String result(msg); - delete[] msg; - return result; + return String (msg, n); } String From b097171c69d9105f211f92da31052100157332d8 Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Fri, 12 May 2017 19:38:03 +0100 Subject: [PATCH 07/21] #6037 Unitialized and unused members in IPCLogOutputter --- src/lib/ipc/IpcLogOutputter.cpp | 1 + src/lib/ipc/IpcLogOutputter.h | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/ipc/IpcLogOutputter.cpp b/src/lib/ipc/IpcLogOutputter.cpp index f215750a..120fd66f 100644 --- a/src/lib/ipc/IpcLogOutputter.cpp +++ b/src/lib/ipc/IpcLogOutputter.cpp @@ -45,6 +45,7 @@ IpcLogOutputter::IpcLogOutputter(IpcServer& ipcServer, EIpcClientType clientType m_running(false), m_notifyCond(ARCH->newCondVar()), m_notifyMutex(ARCH->newMutex()), + m_bufferThreadId(0), m_bufferWaiting(false), m_bufferMaxSize(kBufferMaxSize), m_bufferRateWriteLimit(kBufferRateWriteLimit), diff --git a/src/lib/ipc/IpcLogOutputter.h b/src/lib/ipc/IpcLogOutputter.h index dd2bada6..b6b285b8 100644 --- a/src/lib/ipc/IpcLogOutputter.h +++ b/src/lib/ipc/IpcLogOutputter.h @@ -114,7 +114,6 @@ private: double m_bufferRateTimeLimit; UInt16 m_bufferWriteCount; double m_bufferRateStart; - bool m_useThread; EIpcClientType m_clientType; ArchMutex m_runningMutex; }; From 58e8e068127ae3d051a108254f0fbcc2a1477152 Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Fri, 12 May 2017 19:47:03 +0100 Subject: [PATCH 08/21] #6037 Unitialized member in SecureSocket --- src/lib/net/SecureSocket.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/net/SecureSocket.cpp b/src/lib/net/SecureSocket.cpp index c190750b..9dd3a816 100644 --- a/src/lib/net/SecureSocket.cpp +++ b/src/lib/net/SecureSocket.cpp @@ -57,6 +57,7 @@ SecureSocket::SecureSocket( IEventQueue* events, SocketMultiplexer* socketMultiplexer) : TCPSocket(events, socketMultiplexer), + m_ssl(nullptr), m_secureReady(false), m_fatal(false) { @@ -67,6 +68,7 @@ SecureSocket::SecureSocket( SocketMultiplexer* socketMultiplexer, ArchSocket socket) : TCPSocket(events, socketMultiplexer, socket), + m_ssl(nullptr), m_secureReady(false), m_fatal(false) { From c5561841149d4231a47f785030fd5549616b6780 Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Fri, 12 May 2017 19:50:38 +0100 Subject: [PATCH 09/21] #6037 Remove pointless cast in TCPSocket --- src/lib/net/TCPSocket.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/net/TCPSocket.cpp b/src/lib/net/TCPSocket.cpp index 9498e946..ff69ab2b 100644 --- a/src/lib/net/TCPSocket.cpp +++ b/src/lib/net/TCPSocket.cpp @@ -330,7 +330,7 @@ TCPSocket::doRead() memset(buffer, 0, sizeof(buffer)); size_t bytesRead = 0; - bytesRead = (int) ARCH->readSocket(m_socket, buffer, sizeof(buffer)); + bytesRead = ARCH->readSocket(m_socket, buffer, sizeof(buffer)); if (bytesRead > 0) { bool wasEmpty = (m_inputBuffer.getSize() == 0); From ae8db8b125bf21ecd5304c67b9befaf0ce99d7c7 Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Fri, 12 May 2017 20:02:51 +0100 Subject: [PATCH 10/21] #6037 prevent object slicing in caught exception --- src/lib/platform/MSWindowsSession.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/platform/MSWindowsSession.cpp b/src/lib/platform/MSWindowsSession.cpp index 9e817b1e..b70de74c 100644 --- a/src/lib/platform/MSWindowsSession.cpp +++ b/src/lib/platform/MSWindowsSession.cpp @@ -187,7 +187,7 @@ MSWindowsSession::getActiveDesktopName() CloseDesktop(hd); } } - catch (std::exception error) { + catch (std::exception& error) { LOG((CLOG_ERR "failed to get active desktop name: %s", error.what())); } From 762718d9388d780728232933b8522389be0e679d Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Fri, 12 May 2017 20:15:57 +0100 Subject: [PATCH 11/21] #6037 Use MAKEINTATOM macro in place of dodgy casts --- src/lib/platform/MSWindowsDesks.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/platform/MSWindowsDesks.cpp b/src/lib/platform/MSWindowsDesks.cpp index 325e4578..c377ab76 100644 --- a/src/lib/platform/MSWindowsDesks.cpp +++ b/src/lib/platform/MSWindowsDesks.cpp @@ -427,7 +427,7 @@ void MSWindowsDesks::destroyClass(ATOM windowClass) const { if (windowClass != 0) { - UnregisterClass(reinterpret_cast(windowClass), + UnregisterClass(MAKEINTATOM(windowClass), MSWindowsScreen::getWindowInstance()); } } @@ -437,7 +437,7 @@ MSWindowsDesks::createWindow(ATOM windowClass, const char* name) const { HWND window = CreateWindowEx(WS_EX_TRANSPARENT | WS_EX_TOOLWINDOW, - reinterpret_cast(windowClass), + MAKEINTATOM(windowClass), name, WS_POPUP, 0, 0, 1, 1, From 40e943d1455f626d87fead19f20ce5166e0d9ae9 Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Fri, 12 May 2017 20:40:07 +0100 Subject: [PATCH 12/21] #6037 Use of non-memsize type for pointer arithmetic --- src/lib/arch/IArchString.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/lib/arch/IArchString.cpp b/src/lib/arch/IArchString.cpp index 05cc2dfb..57365363 100644 --- a/src/lib/arch/IArchString.cpp +++ b/src/lib/arch/IArchString.cpp @@ -42,7 +42,7 @@ int IArchString::convStringWCToMB(char* dst, const wchar_t* src, UInt32 n, bool* errors) { - int len = 0; + ptrdiff_t len = 0; bool dummyErrors; if (errors == NULL) { @@ -58,14 +58,14 @@ IArchString::convStringWCToMB(char* dst, if (dst == NULL) { char dummy[MB_LEN_MAX]; for (const wchar_t* scan = src; n > 0; ++scan, --n) { - int mblen = wctomb(dummy, *scan); + ptrdiff_t mblen = wctomb(dummy, *scan); if (mblen == -1) { *errors = true; mblen = 1; } len += mblen; } - int mblen = wctomb(dummy, L'\0'); + ptrdiff_t mblen = wctomb(dummy, L'\0'); if (mblen != -1) { len += mblen - 1; } @@ -73,7 +73,7 @@ IArchString::convStringWCToMB(char* dst, else { char* dst0 = dst; for (const wchar_t* scan = src; n > 0; ++scan, --n) { - int mblen = wctomb(dst, *scan); + ptrdiff_t mblen = wctomb(dst, *scan); if (mblen == -1) { *errors = true; *dst++ = '?'; @@ -82,12 +82,12 @@ IArchString::convStringWCToMB(char* dst, dst += mblen; } } - int mblen = wctomb(dst, L'\0'); + ptrdiff_t mblen = wctomb(dst, L'\0'); if (mblen != -1) { // don't include nul terminator dst += mblen - 1; } - len = (int)(dst - dst0); + len = dst - dst0; } ARCH->unlockMutex(s_mutex); @@ -98,7 +98,7 @@ int IArchString::convStringMBToWC(wchar_t* dst, const char* src, UInt32 n, bool* errors) { - int len = 0; + ptrdiff_t len = 0; wchar_t dummy; bool dummyErrors; @@ -114,7 +114,7 @@ IArchString::convStringMBToWC(wchar_t* dst, if (dst == NULL) { for (const char* scan = src; n > 0; ) { - int mblen = mbtowc(&dummy, scan, n); + ptrdiff_t mblen = mbtowc(&dummy, scan, n); switch (mblen) { case -2: // incomplete last character. convert to unknown character. @@ -150,7 +150,7 @@ IArchString::convStringMBToWC(wchar_t* dst, else { wchar_t* dst0 = dst; for (const char* scan = src; n > 0; ++dst) { - int mblen = mbtowc(dst, scan, n); + ptrdiff_t mblen = mbtowc(dst, scan, n); switch (mblen) { case -2: // incomplete character. convert to unknown character. @@ -181,7 +181,7 @@ IArchString::convStringMBToWC(wchar_t* dst, break; } } - len = (int)(dst - dst0); + len = dst - dst0; } ARCH->unlockMutex(s_mutex); From 3e6920964a6f304f90a751d83b9a8267ba06437d Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Thu, 18 May 2017 00:03:34 +0100 Subject: [PATCH 13/21] #6037 Unitialized members in MSWindowsScreenSaver --- src/lib/platform/MSWindowsScreenSaver.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/platform/MSWindowsScreenSaver.cpp b/src/lib/platform/MSWindowsScreenSaver.cpp index f6a9d386..96771b27 100644 --- a/src/lib/platform/MSWindowsScreenSaver.cpp +++ b/src/lib/platform/MSWindowsScreenSaver.cpp @@ -50,6 +50,9 @@ MSWindowsScreenSaver::MSWindowsScreenSaver() : m_process(NULL), m_watch(NULL), m_threadID(0), + m_msg(0), + m_wParam(0), + m_lParam(0), m_active(false) { // check if screen saver is enabled From bae51a440678d1ac7baaf7f0660015f5d360094b Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Thu, 18 May 2017 00:06:56 +0100 Subject: [PATCH 14/21] #6037 Use MAKEINTATOM in MSWindowsScreen --- src/lib/platform/MSWindowsScreen.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/platform/MSWindowsScreen.cpp b/src/lib/platform/MSWindowsScreen.cpp index bcb794e1..a19731a6 100644 --- a/src/lib/platform/MSWindowsScreen.cpp +++ b/src/lib/platform/MSWindowsScreen.cpp @@ -858,7 +858,7 @@ void MSWindowsScreen::destroyClass(ATOM windowClass) const { if (windowClass != 0) { - UnregisterClass(reinterpret_cast(windowClass), s_windowInstance); + UnregisterClass(MAKEINTATOM(windowClass), s_windowInstance); } } @@ -889,7 +889,7 @@ MSWindowsScreen::createDropWindow(ATOM windowClass, const char* name) const WS_EX_TOPMOST | WS_EX_TRANSPARENT | WS_EX_ACCEPTFILES, - reinterpret_cast(m_class), + MAKEINTATOM(m_class), name, WS_POPUP, 0, 0, m_dropWindowSize, m_dropWindowSize, From 0c2b89ed2139329bfcdb249eaae27615be880408 Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Thu, 18 May 2017 00:32:59 +0100 Subject: [PATCH 15/21] #6037 Fix key repeat expression always false --- src/lib/platform/MSWindowsScreen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/platform/MSWindowsScreen.cpp b/src/lib/platform/MSWindowsScreen.cpp index a19731a6..26fb8dc8 100644 --- a/src/lib/platform/MSWindowsScreen.cpp +++ b/src/lib/platform/MSWindowsScreen.cpp @@ -1129,7 +1129,7 @@ MSWindowsScreen::onKey(WPARAM wParam, LPARAM lParam) KeyModifierMask oldState = pollActiveModifiers(); // check for autorepeat - if (m_keyState->testAutoRepeat(down, (lParam & 0x40000000u) == 1, button)) { + if (m_keyState->testAutoRepeat(down, (lParam & 0x40000000u), button)) { lParam |= 0x40000000u; } From b0c80b419aee8cd604c8f9c4b58b820dd542be54 Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Thu, 18 May 2017 00:46:02 +0100 Subject: [PATCH 16/21] #6037 Unitialized pointer in DataDownloader --- src/gui/src/DataDownloader.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/src/DataDownloader.cpp b/src/gui/src/DataDownloader.cpp index 50e5a1b2..4f778489 100644 --- a/src/gui/src/DataDownloader.cpp +++ b/src/gui/src/DataDownloader.cpp @@ -19,6 +19,7 @@ DataDownloader::DataDownloader(QObject* parent) : QObject(parent), + m_pReply(nullptr), m_IsFinished(false) { connect(&m_NetworkManager, SIGNAL(finished(QNetworkReply*)), From cc2f1146ea36147717c03ede8e2bcae9d53a9cdb Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Thu, 18 May 2017 00:55:46 +0100 Subject: [PATCH 17/21] #6037 Fix broken override in ScreenSetupView --- src/gui/src/ScreenSetupView.cpp | 2 +- src/gui/src/ScreenSetupView.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/src/ScreenSetupView.cpp b/src/gui/src/ScreenSetupView.cpp index a06dc269..f26d9700 100644 --- a/src/gui/src/ScreenSetupView.cpp +++ b/src/gui/src/ScreenSetupView.cpp @@ -38,7 +38,7 @@ ScreenSetupView::ScreenSetupView(QWidget* parent) : verticalHeader()->hide(); } -void ScreenSetupView::setModel(ScreenSetupModel* model) +void ScreenSetupView::setModel(QAbstractItemModel* model) { QTableView::setModel(model); setTableSize(); diff --git a/src/gui/src/ScreenSetupView.h b/src/gui/src/ScreenSetupView.h index a4f04923..38eae2a4 100644 --- a/src/gui/src/ScreenSetupView.h +++ b/src/gui/src/ScreenSetupView.h @@ -39,7 +39,7 @@ class ScreenSetupView : public QTableView ScreenSetupView(QWidget* parent); public: - void setModel(ScreenSetupModel* model); + void setModel(QAbstractItemModel* model) override; ScreenSetupModel* model() const; protected: From e608f8f0814454b14f9cb06a3d807b89d3f93463 Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Thu, 18 May 2017 01:00:16 +0100 Subject: [PATCH 18/21] #6037 Fix broken override in ZeroconfServer --- src/gui/src/ZeroconfServer.cpp | 2 +- src/gui/src/ZeroconfServer.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/src/ZeroconfServer.cpp b/src/gui/src/ZeroconfServer.cpp index d3d98518..e4d6dfd8 100644 --- a/src/gui/src/ZeroconfServer.cpp +++ b/src/gui/src/ZeroconfServer.cpp @@ -25,7 +25,7 @@ ZeroconfServer::ZeroconfServer(QObject* parent) : { } -void ZeroconfServer::incomingConnection(int socketDescriptor) +void ZeroconfServer::incomingConnection(qintptr socketDescriptor) { ZeroconfThread* thread = new ZeroconfThread(socketDescriptor, this); connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater())); diff --git a/src/gui/src/ZeroconfServer.h b/src/gui/src/ZeroconfServer.h index 01e713d7..2f6c6f11 100644 --- a/src/gui/src/ZeroconfServer.h +++ b/src/gui/src/ZeroconfServer.h @@ -30,7 +30,7 @@ public: ZeroconfServer(QObject* parent = 0); protected: - void incomingConnection(int socketDescriptor); + void incomingConnection(qintptr socketDescriptor) override; private: QStringList fortunes; From 857482ced72dd13c038161e873567de4ae6f8251 Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Thu, 18 May 2017 01:09:38 +0100 Subject: [PATCH 19/21] #6037 Unitialized members in App class --- src/lib/synergy/App.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/synergy/App.cpp b/src/lib/synergy/App.cpp index 81ab826c..4c8c1808 100644 --- a/src/lib/synergy/App.cpp +++ b/src/lib/synergy/App.cpp @@ -62,9 +62,11 @@ App::App(IEventQueue* events, CreateTaskBarReceiverFunc createTaskBarReceiver, A m_suspended(false), m_events(events), m_args(args), + m_fileLog(nullptr), m_createTaskBarReceiver(createTaskBarReceiver), m_appUtil(events), - m_ipcClient(nullptr) + m_ipcClient(nullptr), + m_socketMultiplexer(nullptr) { assert(s_instance == nullptr); s_instance = this; From b87dba52ba005e7991ba92f1a543a20edd9e5d5a Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Thu, 18 May 2017 01:10:58 +0100 Subject: [PATCH 20/21] #6037 Unitialized member in Chunk --- src/lib/synergy/Chunk.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/synergy/Chunk.cpp b/src/lib/synergy/Chunk.cpp index 0bd8a62c..71464f70 100644 --- a/src/lib/synergy/Chunk.cpp +++ b/src/lib/synergy/Chunk.cpp @@ -18,7 +18,7 @@ #include "synergy/Chunk.h" #include "base/String.h" -Chunk::Chunk(size_t size) +Chunk::Chunk(size_t size): m_dataSize(0) { m_chunk = new char[size]; memset(m_chunk, 0, size); From 98e617a937fefefa97958fde9524109b9a712719 Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Thu, 18 May 2017 01:20:22 +0100 Subject: [PATCH 21/21] #6037 Use MAKINTATOM in MSWindowsScreen --- src/lib/platform/MSWindowsScreen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/platform/MSWindowsScreen.cpp b/src/lib/platform/MSWindowsScreen.cpp index 26fb8dc8..080db53d 100644 --- a/src/lib/platform/MSWindowsScreen.cpp +++ b/src/lib/platform/MSWindowsScreen.cpp @@ -868,7 +868,7 @@ MSWindowsScreen::createWindow(ATOM windowClass, const char* name) const HWND window = CreateWindowEx(WS_EX_TOPMOST | WS_EX_TRANSPARENT | WS_EX_TOOLWINDOW, - reinterpret_cast(windowClass), + MAKEINTATOM(windowClass), name, WS_POPUP, 0, 0, 1, 1,