mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
f101f7c9ba
Honor the length argument in `buf.write(s, 0, buf.length, 'base64')`. Before this commit, the length argument was ignored. The decoder would keep writing until it hit the end of the buffer. Since most buffers in Node are slices of a parent buffer (the slab), this bug would overwrite the content of adjacent buffers. The bug is trivially demonstrated with the following test case: var assert = require('assert'); var a = Buffer(3); var b = Buffer('xxx'); a.write('aaaaaaaa', 'base64'); assert.equal(b.toString(), 'xxx'); This commit coincidentally also fixes a bug where Buffer._charsWritten was not updated for zero length buffers. |
||
---|---|---|
.. | ||
disabled | ||
fixtures | ||
internet | ||
message | ||
pummel | ||
simple | ||
CMakeLists.txt | ||
common.js |