irungentoo/ProjectTox-Core — pull request #571 by FullName (2013-09-11 10:06:20+00:00)
Title: networking_poll: fixed missing initialization of length parameter

Unfixed state:
receivepacket turns buffer, length to recvfrom, which assumes buffer is length bytes long.
length is not initialized, so recvfrom gets a random length to write to, maybe overwriting the actual buffer.
If multiple packets are received, subsequent packets of larger size WILL be truncated to the length of the smallest previous packet, because recvfrom reduces length to the actually used length.

Fixed state:
Length is initialized to the actual buffer size and reinitialized for subsequent packets.