From aa4c0d86febc8d871b9ba03913c975999f0a6367 Mon Sep 17 00:00:00 2001 From: Stan Kladko <13399135+kladkogex@users.noreply.github.com> Date: Mon, 6 Nov 2023 13:07:55 +0000 Subject: [PATCH] #1702 changed [] to at() for safe vector access --- libethereum/ChainParams.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libethereum/ChainParams.cpp b/libethereum/ChainParams.cpp index 837530bee..930bbf1a5 100644 --- a/libethereum/ChainParams.cpp +++ b/libethereum/ChainParams.cpp @@ -293,10 +293,10 @@ ChainParams ChainParams::loadConfig( auto groupNodesObj = nodeGroupObj["nodes"].get_obj(); for ( const auto& groupNodeConf : groupNodesObj ) { auto groupNodeConfObj = groupNodeConf.second.get_array(); - u256 sChainIndex = groupNodeConfObj[0].get_uint64(); - u256 id = groupNodeConfObj[1].get_uint64(); - std::string publicKey = groupNodeConfObj[2].get_str(); - std::string address = groupNodeConfObj[3].get_str(); + u256 sChainIndex = groupNodeConfObj.at(0).get_uint64(); + u256 id = groupNodeConfObj.at(1).get_uint64(); + std::string publicKey = groupNodeConfObj.at(2).get_str(); + std::string address = groupNodeConfObj.at(3).get_str(); groupNodes.push_back( { id, sChainIndex, publicKey, address } ); } std::sort( groupNodes.begin(), groupNodes.end(),