diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2014-12-02 12:53:30 -0800 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2014-12-02 12:53:30 -0800 |
commit | 30e82a4d9c8f4fc336373ea8a98571c890298379 (patch) | |
tree | 68dfe0432378872e25560bb754ecec3127cfedd9 /node | |
parent | 8c64046a5362432160e4db3e1079c755ab321caf (diff) | |
download | infinitytier-30e82a4d9c8f4fc336373ea8a98571c890298379.tar.gz infinitytier-30e82a4d9c8f4fc336373ea8a98571c890298379.zip |
Fix network enumeration buffer size bug -- reported by user Neal Symms via LiveAgent
Diffstat (limited to 'node')
-rw-r--r-- | node/Node.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/node/Node.cpp b/node/Node.cpp index fc459af5..19badced 100644 --- a/node/Node.cpp +++ b/node/Node.cpp @@ -993,7 +993,7 @@ ZT1_Node_NetworkList *Node::listNetworks() unsigned long returnBufSize = sizeof(ZT1_Node_NetworkList); for(unsigned long i=0;i<networks.size();++i) { - nconfs[i] = networks[i]->config2(); + nconfs[i] = networks[i]->config2(); // note: can return NULL ipsv[i] = networks[i]->ips(); returnBufSize += sizeof(ZT1_Node_Network) + (sizeof(ZT1_Node_PhysicalAddress) * (unsigned int)ipsv[i].size()); } @@ -1015,7 +1015,7 @@ ZT1_Node_NetworkList *Node::listNetworks() _fillNetworkQueryResultBuffer(networks[i],nconfs[i],nbuf); nbuf->ips = (ZT1_Node_PhysicalAddress *)buf; - buf += sizeof(ZT1_Node_PhysicalAddress); + buf += sizeof(ZT1_Node_PhysicalAddress) * ipsv[i].size(); nbuf->numIps = 0; for(std::set<InetAddress>::iterator ip(ipsv[i].begin());ip!=ipsv[i].end();++ip) { |