crash fix

This commit is contained in:
Adam Ierymenko 2019-08-29 07:25:16 -07:00
parent 6e3e09bed4
commit ee7361ee2e
No known key found for this signature in database
GPG Key ID: C8877CF2D7A5D7F3

View File

@ -336,6 +336,7 @@ static void handlePacket(const int sock,const InetAddress *const ip,Packet &pkt)
if (introduce) {
std::lock_guard<std::mutex> l(peersByVirtAddr_l);
auto sources = peersByVirtAddr.find(source);
if (sources != peersByVirtAddr.end()) {
for(auto a=sources->second.begin();a!=sources->second.end();++a) {
for(auto b=toAddrs.begin();b!=toAddrs.end();++b) {
if (((*a)->ip6 == *ip)&&(b->second->ip6)) {
@ -382,6 +383,7 @@ static void handlePacket(const int sock,const InetAddress *const ip,Packet &pkt)
}
}
}
}
if (fragment) {
if (reinterpret_cast<Packet::Fragment *>(&pkt)->incrementHops() >= ZT_PROTO_MAX_HOPS) {