From 9311a240449709160b324c4c1241a3750f8f6754 Mon Sep 17 00:00:00 2001 From: eversinc33 Date: Sat, 28 Dec 2024 23:31:46 +0100 Subject: [PATCH] validate ip parameter in set_bans rpc call --- src/rpc/core_rpc_server.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp index fa753252a..426d8b295 100644 --- a/src/rpc/core_rpc_server.cpp +++ b/src/rpc/core_rpc_server.cpp @@ -2875,6 +2875,12 @@ namespace cryptonote } else { + if (!i->ip) + { + error_resp.code = CORE_RPC_ERROR_CODE_WRONG_PARAM; + error_resp.message = "No ip/host supplied"; + return false; + } na = epee::net_utils::ipv4_network_address{i->ip, 0}; } if (i->ban)