lib/core: fix Reader::read
authorLucas Bajolet <lucas.bajolet@gmail.com>
Fri, 11 May 2018 00:48:31 +0000 (20:48 -0400)
committerLucas Bajolet <lucas.bajolet@gmail.com>
Fri, 11 May 2018 03:16:40 +0000 (23:16 -0400)
commit8386ac8a0c7162bbd3d65f3ad119996e73ecd66d
tree57acd9787efbc3deaf46d4b45bfd0edbe086200c
parent6ddf6c8bd94407fd3e1bc978f72f7770ea7be164
lib/core: fix Reader::read

Reader::read would crash if trying to read from an empty socket, as the
codec::decode_string would be called with a negative length.

We add a failsafe to prevent that.

Signed-off-by: Lucas Bajolet <lucas.bajolet@gmail.com>
lib/core/stream.nit