Skip to content

Commit e0451e3

Browse files
committed
Fix subscript[0] bug in net.cpp if GetGroup returns a 0-sized vector
1 parent 1d4805c commit e0451e3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/net.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2876,5 +2876,5 @@ uint64_t CConnman::CalculateKeyedNetGroup(const CAddress& ad) const
28762876
{
28772877
std::vector<unsigned char> vchNetGroup(ad.GetGroup());
28782878

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

0 commit comments

Comments
 (0)