LaurentGomila/SFML — Issue #117: sf::Packet::operator>>(char*) is unsafe
Author: Fanael
Created: 2011-10-31 10:05:23+00:00
State: open

The title says it all, this method (plus its `wchar_t` equivalent) is unsafe, as there's no way to specify the size of the buffer.

I suggest you should make it something like `sf::Packet::read(char* buffer, size_t size)` and write no more than `size` bytes into the buffer. Should someone want a buffer overflow, the old behavior can still be gotten by making a call like `packet.read(buffer, -1)`.