joyent/node — pull request #7370 by indutny (2014-03-27 17:49:10+00:00)
Title: buffer: truncate buffer after string decode

When our estimates for a storage size are higher than the actual length
of decoded data, the destination buffer should be truncated. Otherwise
`Buffer::Length` will give misleading information to C++ layer.

fix #7365