From 95215c78d3554a79b2732f2d6cc5f4c16a015119 Mon Sep 17 00:00:00 2001 From: Stan Kladko <13399135+kladkogex@users.noreply.github.com> Date: Mon, 6 Nov 2023 13:15:07 +0000 Subject: [PATCH] #1702 added param validation --- libethereum/ChainParams.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libethereum/ChainParams.cpp b/libethereum/ChainParams.cpp index 930bbf1a5..8015741d1 100644 --- a/libethereum/ChainParams.cpp +++ b/libethereum/ChainParams.cpp @@ -297,6 +297,12 @@ ChainParams ChainParams::loadConfig( u256 id = groupNodeConfObj.at(1).get_uint64(); std::string publicKey = groupNodeConfObj.at(2).get_str(); std::string address = groupNodeConfObj.at(3).get_str(); + if (publicKey.empty()) { + BOOST_THROW_EXCEPTION(std::runtime_error("Empty public key in config")); + } + if (address.empty()) { + BOOST_THROW_EXCEPTION(std::runtime_error("Empty address in config")); + } groupNodes.push_back( { id, sChainIndex, publicKey, address } ); } std::sort( groupNodes.begin(), groupNodes.end(),