Official eMule-Board: Bug In Addreqblock - Official eMule-Board

Jump to content


Page 1 of 1

Bug In Addreqblock

#1 User is offline   DavidXanatos 

  • Neo Dev
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1469
  • Joined: 23-April 04

Posted 17 January 2014 - 02:14 PM

in void CUpDownClient::AddReqBlock(Requested_Block_Struct* reqblock)

there is a check:
	for (POSITION pos = m_DoneBlocks_list.GetHeadPosition(); pos != 0; ){
 	const Requested_Block_Struct* cur_reqblock = m_DoneBlocks_list.GetNext(pos);
 	if (reqblock->StartOffset == cur_reqblock->StartOffset && reqblock->EndOffset == cur_reqblock->EndOffset){
 	delete reqblock;
 	return;
 	}
	}
	for (POSITION pos = m_BlockRequests_queue.GetHeadPosition(); pos != 0; ){
 	const Requested_Block_Struct* cur_reqblock = m_BlockRequests_queue.GetNext(pos);
 	if (reqblock->StartOffset == cur_reqblock->StartOffset && reqblock->EndOffset == cur_reqblock->EndOffset){
 	delete reqblock;
 	return;
 	}
	}


it should be howeever:
	for (POSITION pos = m_DoneBlocks_list.GetHeadPosition(); pos != 0; ){
 	const Requested_Block_Struct* cur_reqblock = m_DoneBlocks_list.GetNext(pos);
 	if (reqblock->StartOffset == cur_reqblock->StartOffset && reqblock->EndOffset == cur_reqblock->EndOffset
			&& memcmp(reqblock->FileID, cur_reqblock->FileID, 16) == 0){
 	delete reqblock;
 	return;
 	}
	}
	for (POSITION pos = m_BlockRequests_queue.GetHeadPosition(); pos != 0; ){
 	const Requested_Block_Struct* cur_reqblock = m_BlockRequests_queue.GetNext(pos);
 	if (reqblock->StartOffset == cur_reqblock->StartOffset && reqblock->EndOffset == cur_reqblock->EndOffset
			&& memcmp(reqblock->FileID, cur_reqblock->FileID, 16) == 0){
 	delete reqblock;
 	return;
 	}
	}


without checking the FileID the upload wil fail if a client after completing one file switches to an other and requests the same range
NeoLoader is a new file sharing client, supporting ed2k/eMule, Bittorent and one click hosters,
it is the first client to be able to download form multiple networks the same file.
NL provides the first fully decentralized scalable torrent and DDL keyword search,
it implements an own novel anonymous file sharing network, providing anonymity and deniability to its users,
as well as many other new features.
It is written in C++ with Qt and is available for Windows, Linux and MacOS.
0

#2 User is offline   fox88 

  • Golden eMule
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 4974
  • Joined: 13-May 07

Posted 28 February 2015 - 11:00 AM

It seems to be a valid point, but as usual there was no respose from devs or code changes, as if this message was ignored.

Additionally, it is good practice to use sizeof() instead of constant wherever applicable. In this case:
memcmp(reqblock->FileID, cur_reqblock->FileID, sizeof(reqblock->FileID))
0

#3 User is offline   Some Support 

  • Last eMule
  • PipPipPipPipPipPipPip
  • Group: Yes
  • Posts: 3667
  • Joined: 27-June 03

Posted 28 February 2015 - 09:05 PM

Yes, might be a (in practice probably really rare) bug. I'm not actually sure if it is allowed to happen, you have to set the requested file first after all and can't just switch it in the reqblocks.

#4 User is offline   fox88 

  • Golden eMule
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 4974
  • Joined: 13-May 07

Posted 01 March 2015 - 09:07 AM

View PostSome Support, on 01 March 2015 - 12:05 AM, said:

I'm not actually sure if it is allowed to happen, you have to set the requested file first after all and can't just switch it in the reqblocks.

Мisbehaving client are allowed to send any request or data any time.
0

#5 User is offline   DavidXanatos 

  • Neo Dev
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1469
  • Joined: 23-April 04

Posted 01 March 2015 - 12:15 PM

Well its possible in the protocol so I would argue that was intended by the authors,
or else why waist 16 bytes in each request packet, to send the already set file ID.

So that should be fixed in the next release.
NeoLoader is a new file sharing client, supporting ed2k/eMule, Bittorent and one click hosters,
it is the first client to be able to download form multiple networks the same file.
NL provides the first fully decentralized scalable torrent and DDL keyword search,
it implements an own novel anonymous file sharing network, providing anonymity and deniability to its users,
as well as many other new features.
It is written in C++ with Qt and is available for Windows, Linux and MacOS.
0

#6 User is offline   tHeWiZaRdOfDoS 

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

Posted 01 March 2015 - 04:35 PM

This code has been in eMule+ for ages - just for the reference. :flowers:
0

#7 User is offline   fox88 

  • Golden eMule
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 4974
  • Joined: 13-May 07

Posted 01 March 2015 - 09:11 PM

View PosttHeWiZaRdOfDoS, on 01 March 2015 - 07:35 PM, said:

This code has been in eMule+ for ages - just for the reference.

Here the method AddReqBlock() starts at line 880, right?
I do not see hash comparison there, though it is used in AddRequestCount() with md4cmp() (should be preferable to memcmp()).
Maybe some other mod?
0

  • Member Options

Page 1 of 1

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