Skip to content

Commit

Permalink
Fix subscript[0] bug in net.cpp if GetGroup returns a 0-sized vector
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremyRubin authored and furszy committed May 8, 2021
1 parent af4cba3 commit 48a622d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2604,6 +2604,6 @@ uint64_t CConnman::CalculateKeyedNetGroup(const CAddress& ad)
{
std::vector<unsigned char> vchNetGroup(ad.GetGroup());

return GetDeterministicRandomizer(RANDOMIZER_ID_NETGROUP).Write(&vchNetGroup[0], vchNetGroup.size()).Finalize();
return GetDeterministicRandomizer(RANDOMIZER_ID_NETGROUP).Write(vchNetGroup.data(), vchNetGroup.size()).Finalize();
}

0 comments on commit 48a622d

Please sign in to comment.