buffer: throw range error before truncating write
The check to determine whether `noAssert` was set to true and thus whether RangeErrors should be thrown was happening after the write was truncated to the available size of the buffer. These checks now occur in the correct order. Fixes: https://github.com/nodejs/node/issues/5587 PR-URL: https://github.com/nodejs/node/pull/5605 Reviewed-By:Trevor Norris <trev.norris@gmail.com> Reviewed-By:
James M Snell <jasnell@gmail.com>
parent
341b3d01
Please register or sign in to comment