removed uninitialized memory read in determination of own IP

This commit is contained in:
csoler 2018-11-01 22:05:22 +01:00
parent cb5d247565
commit 33b39a8be6
No known key found for this signature in database
GPG Key ID: 7BCA522266C0804C

View File

@ -1673,6 +1673,7 @@ bool p3PeerMgrIMPL::addCandidateForOwnExternalAddress(const RsPeerId &from, cons
bool p3PeerMgrIMPL::locked_computeCurrentBestOwnExtAddressCandidate(sockaddr_storage& addr, uint32_t& count)
{
sockaddr_storage_clear(addr);
std::map<sockaddr_storage, pqi::ZeroedInt> addr_counts ;
for(std::map<RsPeerId,sockaddr_storage>::iterator it(mReportedOwnAddresses.begin());it!=mReportedOwnAddresses.end();++it)
@ -1697,7 +1698,7 @@ bool p3PeerMgrIMPL::locked_computeCurrentBestOwnExtAddressCandidate(sockaddr_sto
#endif
}
return true ;
return count > 0 ;
}
bool p3PeerMgrIMPL::getExtAddressReportedByFriends(sockaddr_storage &addr, uint8_t& /*isstable*/)