summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrant Limberg <grant.limberg@zerotier.com>2017-09-28 10:39:43 -0700
committerGrant Limberg <grant.limberg@zerotier.com>2017-09-28 10:39:43 -0700
commite564c56dce6a6ad4dccb68af2c6c8d4a7148a298 (patch)
tree87e9aed6de4804759a554bac160a3198c96c51eb
parent239c2540d6798b897944c7a719f27d61479e21cc (diff)
downloadinfinitytier-e564c56dce6a6ad4dccb68af2c6c8d4a7148a298.tar.gz
infinitytier-e564c56dce6a6ad4dccb68af2c6c8d4a7148a298.zip
Set size of buffer after setting data with unsafeData() call
-rw-r--r--node/Topology.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/node/Topology.cpp b/node/Topology.cpp
index 905b6a91..bfa62ff5 100644
--- a/node/Topology.cpp
+++ b/node/Topology.cpp
@@ -127,6 +127,7 @@ SharedPtr<Peer> 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<Peer> &ap = _peers[zta];
if (ap)