thlorenz/libuv-dox — pull request #1 by nickelpro (2014-01-06 23:45:26+00:00)
Title: Stop sending random crap in tcp-echo-server

tcp-echo-server currently sends an unaltered buf out, which is bad since buf.len can be much larger than nread. This can lead to sending thousands of null bytes, to just sending random crap out on the wire.

Trivial python script that illustrates the problem: https://gist.github.com/nickelpro/fa2ca0fd7ffa39b5d8da

Only safe for single client server, two clients and bad things happen. But we're already freeing base in the read callback so obviously we live on the wild side.