From e0451e3e2af64cc975dd76389dc3ea4f8b9c2a62 Mon Sep 17 00:00:00 2001 From: Jeremy Rubin Date: Sun, 19 Feb 2017 13:18:04 -0500 Subject: [PATCH] Fix subscript[0] bug in net.cpp if GetGroup returns a 0-sized vector --- src/net.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/net.cpp b/src/net.cpp index 301cf58b87..5bf3af7ea3 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -2876,5 +2876,5 @@ uint64_t CConnman::CalculateKeyedNetGroup(const CAddress& ad) const { std::vector 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(); }