mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-25 23:45:49 -04:00
removed uninitialized memory read in determination of own IP
This commit is contained in:
parent
cb5d247565
commit
33b39a8be6
1 changed files with 2 additions and 1 deletions
|
@ -1673,6 +1673,7 @@ bool p3PeerMgrIMPL::addCandidateForOwnExternalAddress(const RsPeerId &from, cons
|
||||||
|
|
||||||
bool p3PeerMgrIMPL::locked_computeCurrentBestOwnExtAddressCandidate(sockaddr_storage& addr, uint32_t& count)
|
bool p3PeerMgrIMPL::locked_computeCurrentBestOwnExtAddressCandidate(sockaddr_storage& addr, uint32_t& count)
|
||||||
{
|
{
|
||||||
|
sockaddr_storage_clear(addr);
|
||||||
std::map<sockaddr_storage, pqi::ZeroedInt> addr_counts ;
|
std::map<sockaddr_storage, pqi::ZeroedInt> addr_counts ;
|
||||||
|
|
||||||
for(std::map<RsPeerId,sockaddr_storage>::iterator it(mReportedOwnAddresses.begin());it!=mReportedOwnAddresses.end();++it)
|
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
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
return true ;
|
return count > 0 ;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool p3PeerMgrIMPL::getExtAddressReportedByFriends(sockaddr_storage &addr, uint8_t& /*isstable*/)
|
bool p3PeerMgrIMPL::getExtAddressReportedByFriends(sockaddr_storage &addr, uint8_t& /*isstable*/)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue