Official eMule-Board: Memleak In Csearch::processresponse - Official eMule-Board

Jump to content


Page 1 of 1

Memleak In Csearch::processresponse

#1 User is offline   tHeWiZaRdOfDoS 

  • Man, what a bunch of jokers...
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 5630
  • Joined: 28-December 02

Posted 18 July 2012 - 03:55 PM

If we receive a malformed search response, we are currently creating a memleak here:

Quote

// Make sure the node is not sending more results than we requested, which is not only a protocol vialoation
// but most likely a malicous answer
if (plistResults->size() > GetRequestContactCount() && !(pRequestedMoreNodesContact == pFromContact && plistResults->size() <= KADEMLIA_FIND_VALUE_MORE) )
{
DebugLogWarning(_T("Node %s sent more contacts than requested on a routing query, ignoring response"), ipstr(ntohl(uFromIP)));
delete plistResults; //>>> WiZaRd::Memleak FiX
return;
}


because plistResults doesn't get deleted - fix included above. :flowers:

This post has been edited by tHeWiZaRdOfDoS: 18 July 2012 - 03:57 PM

0

#2 User is offline   Riso64Bit 

  • Magnificent Member
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 339
  • Joined: 24-March 09

Posted 11 February 2014 - 09:07 PM

fixed in 0.50b beta 10
0

#3 User is offline   Enig123 

  • Golden eMule
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 553
  • Joined: 22-November 04

Posted 26 November 2014 - 08:46 PM

Shouldn't we also delete all the contact included in the list, as in the catch part?
		for (ContactList::const_iterator it = pResults->begin(); it != pResults->end(); ++it)
			delete *it;
		delete pResults;

0

  • Member Options

Page 1 of 1

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users