Issue information

Issue ID
#209
Status
Working as Intended
Severity
None
Started
Hercules Elf Bot
Oct 11, 2007 10:58
Last Post
Hercules Elf Bot
Apr 5, 2012 8:32
Confirmation
N/A

Hercules Elf Bot - Oct 11, 2007 10:58

Originally posted by [b]theultramage[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=209

The fifo socket functions at the moment don't do any verification of whether the array they're trying to access actually exists (no session for example).
Also, the W-macros assumes that the caller will use WFIFOHEAD before using them, and that wfifohead will provide enough storage.
(actually, wfifoset exits the server if it detects allocation problems)

I think the "session 0 is used for disconnected players" thing might have applied to this once... the macros would have checks and would redirect access to a preallocated session[0]-> buffer. It would need to be big enough to hold all possible packets up to a WFIFOSET call, that would just flush the contents.

Hercules Elf Bot - Dec 17, 2011 6:30

Originally posted by [b]Ind[/b]
in my opinion these checks would just waste CPU unnecessarily. they're meant to be used like that and if you don't you break them, don't need a babysitting check on this case, in my opinion.