fixed another uninitialised memory read in bitdht

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8445 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2015-06-14 15:46:00 +00:00
parent 5116042cf0
commit b0f7b70ea2

View file

@ -421,14 +421,18 @@ DhtPeerDetails *p3BitDht::addInternalPeer_locked(const RsPeerId& pid, uint32_t t
DhtPeerDetails *dpd = findInternalDhtPeer_locked(&id, RSDHT_PEERTYPE_ANY); DhtPeerDetails *dpd = findInternalDhtPeer_locked(&id, RSDHT_PEERTYPE_ANY);
if (!dpd) if (!dpd)
{ {
DhtPeerDetails newdpd; DhtPeerDetails newdpd;
mPeers[id] = newdpd;
dpd = findInternalDhtPeer_locked(&id, RSDHT_PEERTYPE_ANY);
dpd->mDhtId.id = id; newdpd.mDhtId.id = id;
dpd->mRsId = pid; newdpd.mRsId = pid;
dpd->mDhtState = RSDHT_PEERDHT_NOT_ACTIVE; newdpd.mDhtState = RSDHT_PEERDHT_NOT_ACTIVE;
newdpd.mPeerType = RSDHT_PEERTYPE_ANY;
mPeers[id] = newdpd;
dpd = findInternalDhtPeer_locked(&id, RSDHT_PEERTYPE_ANY);
if(dpd == NULL)
std::cerr << "(EE) inconsistency error in p3BitDht::addInternalPeer_locked() Cannot find peer that was just added." << std::endl;
} }
/* what do we need to reset? */ /* what do we need to reset? */