From 3b4a6adc3d153fb4dd3a768b71fed65f0d570075 Mon Sep 17 00:00:00 2001 From: jrd Date: Tue, 21 Jul 2026 20:32:41 +0000 Subject: [PATCH 1/2] Fix jamulus/pollServerList reporting success on invalid address The jamulus/pollServerList RPC handler set response["error"] when the directory address failed to parse, but then unconditionally set response["result"] = "ok" after the if/else, so an invalid socket address was reported as success (with both "error" and "result" present in the response). Remove the stray unconditional assignment. The success branch already sets result = "ok", matching the error-and-return idiom used by every other handler in this file. Fixes #3818 --- src/clientrpc.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/clientrpc.cpp b/src/clientrpc.cpp index 9ba7060a1d..3f11451da0 100644 --- a/src/clientrpc.cpp +++ b/src/clientrpc.cpp @@ -201,8 +201,6 @@ CClientRpc::CClientRpc ( CClient* pClient, CClientSettings* pSettings, CRpcServe response["error"] = CRpcServer::CreateJsonRpcError ( CRpcServer::iErrInvalidParams, "Invalid params: directory is not a valid socket address" ); } - - response["result"] = "ok"; } ); /// @rpc_method jamulus/getMode From d90fbb6a0290bbf50b04e6cdf745e64c478f0861 Mon Sep 17 00:00:00 2001 From: Nils Brederlow <62596379+dingodoppelt@users.noreply.github.com> Date: Wed, 22 Jul 2026 01:15:30 +0200 Subject: [PATCH 2/2] Align with existing code style --- src/clientrpc.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/clientrpc.cpp b/src/clientrpc.cpp index 3f11451da0..1f6671ca9e 100644 --- a/src/clientrpc.cpp +++ b/src/clientrpc.cpp @@ -190,17 +190,16 @@ CClientRpc::CClientRpc ( CClient* pClient, CClientSettings* pSettings, CRpcServe CHostAddress haDirectoryAddress; // Allow IPv4 only for communicating with Directories - if ( NetworkUtil::ParseNetworkAddress ( jsonDirectoryIp.toString(), haDirectoryAddress, false ) ) - { - // send the request for the server list - pClient->CreateCLReqServerListMes ( haDirectoryAddress ); - response["result"] = "ok"; - } - else + if ( !NetworkUtil::ParseNetworkAddress ( jsonDirectoryIp.toString(), haDirectoryAddress, false ) ) { response["error"] = CRpcServer::CreateJsonRpcError ( CRpcServer::iErrInvalidParams, "Invalid params: directory is not a valid socket address" ); + return; } + + // send the request for the server list + pClient->CreateCLReqServerListMes ( haDirectoryAddress ); + response["result"] = "ok"; } ); /// @rpc_method jamulus/getMode