From e564c56dce6a6ad4dccb68af2c6c8d4a7148a298 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Thu, 28 Sep 2017 10:39:43 -0700 Subject: [PATCH] Set size of buffer after setting data with unsafeData() call --- node/Topology.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/node/Topology.cpp b/node/Topology.cpp index 905b6a912..bfa62ff5e 100644 --- a/node/Topology.cpp +++ b/node/Topology.cpp @@ -127,6 +127,7 @@ SharedPtr Topology::getPeer(void *tPtr,const Address &zta) uint64_t idbuf[2]; idbuf[0] = zta.toInt(); idbuf[1] = 0; int len = RR->node->stateObjectGet(tPtr,ZT_STATE_OBJECT_PEER,idbuf,buf.unsafeData(),ZT_PEER_MAX_SERIALIZED_STATE_SIZE); if (len > 0) { + buf.setSize(len); Mutex::Lock _l(_peers_m); SharedPtr &ap = _peers[zta]; if (ap)