From 968848a77b9761f42d4ae1df8a30a48e381024c6 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Wed, 24 Apr 2019 17:27:44 +0000 Subject: wallet_rpc_server: fix crash in validate_address if no wallet is loaded Reported by SmajeNz0 --- src/wallet/wallet_rpc_server.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp index aaad82bb7..fc18e21e8 100644 --- a/src/wallet/wallet_rpc_server.cpp +++ b/src/wallet/wallet_rpc_server.cpp @@ -4067,9 +4067,10 @@ namespace tools { cryptonote::TESTNET, "testnet" }, { cryptonote::STAGENET, "stagenet" }, }; + if (!req.any_net_type && !m_wallet) return not_open(er); for (const auto &net_type: net_types) { - if (!req.any_net_type && net_type.type != m_wallet->nettype()) + if (!req.any_net_type && (!m_wallet || net_type.type != m_wallet->nettype())) continue; if (req.allow_openalias) { -- cgit v1.2.3 From 9074c0d8cf86a1df4d8d0e9018b75df399784fbc Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Wed, 24 Apr 2019 17:28:55 +0000 Subject: wallet_rpc_server: return false on error in set_log_categories Reported by SmajeNz0 --- src/wallet/wallet_rpc_server.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp index fc18e21e8..bfe57698f 100644 --- a/src/wallet/wallet_rpc_server.cpp +++ b/src/wallet/wallet_rpc_server.cpp @@ -4176,7 +4176,7 @@ namespace tools { er.code = WALLET_RPC_ERROR_CODE_INVALID_LOG_LEVEL; er.message = "Error: log level not valid"; - return true; + return false; } mlog_set_log_level(req.level); return true; -- cgit v1.2.3 From 98fb98f93f24344c73d57a38423eb517e5c9f37b Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Wed, 24 Apr 2019 17:29:24 +0000 Subject: wallet_rpc_server: adding missing return on error in set_daemon --- src/wallet/wallet_rpc_server.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp index bfe57698f..b92bcc619 100644 --- a/src/wallet/wallet_rpc_server.cpp +++ b/src/wallet/wallet_rpc_server.cpp @@ -4152,6 +4152,7 @@ namespace tools { er.code = WALLET_RPC_ERROR_CODE_NO_DAEMON_CONNECTION; er.message = "SSL is enabled but no user certificate or fingerprints were provided"; + return false; } if (!m_wallet->set_daemon(req.address, boost::none, req.trusted, std::move(ssl_options))) -- cgit v1.2.3