From 1236fa4cabe8f1639c0bf985c6e04c58470a1092 Mon Sep 17 00:00:00 2001 From: Christian Schmidt Date: Sun, 3 Aug 2025 19:18:09 +0200 Subject: [PATCH] fix: server: initialize the m_protocol member with a default value It is likely random whether the server works or not without a manually configured protocol option, which is neither documented nor enforced to be set. With a random uninitialized value in m_protocol, this can happen: [2025-08-03T12:39:57] NOTE: accepted client connection [2025-08-03T12:39:57] FATAL: a runtime error occurred: XInvalidProtocol Reports of "it works with debug enabled" are likely due to having parts of the memory space the server object is allocated into being cleared, and thus having a 0 (Synergy) startup value. --- src/lib/server/Server.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/server/Server.h b/src/lib/server/Server.h index 66a234486..882de58a5 100644 --- a/src/lib/server/Server.h +++ b/src/lib/server/Server.h @@ -358,7 +358,7 @@ private: }; // used in hello message sent to the client - NetworkProtocol m_protocol; + NetworkProtocol m_protocol = NetworkProtocol::Barrier; // the primary screen client PrimaryClient *m_primaryClient;