Official eMule-Board: Small Bug In Routingzone.cpp - Official eMule-Board

Jump to content


Page 1 of 1

Small Bug In Routingzone.cpp

#1 User is offline   nbingham 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 15-June 10

Posted 15 June 2010 - 05:46 PM

I was looking through the eMule 0.5a source code, and I noticed
what looks to be a very small bug in RoutingZone.cpp on lines
198 and 286. Both lines read something similar to this:

if (uNumContacts != 0 && uNumContacts * 25 <= (file.GetLength() - file.GetPosition()))

This implies that each contact entry in nodes.dat is 25 bytes.
However, you then go on to read 34 bytes per contact entry.
Just thought that this would save one or two headaches later.

If there is a reason to check for 25 bytes per entry, then
I am wrong.

Thanks,
Ned Bingham
0

#2 User is offline   Some Support 

  • Last eMule
  • PipPipPipPipPipPipPip
  • Group: Yes
  • Posts: 3,411
  • Joined: 27-June 03

Posted 15 June 2010 - 06:58 PM

Quote

This implies that each contact entry in nodes.dat is 25 bytes.

No, it implies that each contact entry is at least 25 bytes big (they differ depending on the version) and is just a quick sanity check if the file is corrupted. The one in line 286 indeed checks for the excact size and contacts there will always have that size.

  • Member Options

Page 1 of 1

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