Commit 72fb796b authored by Matt Loring's avatar Matt Loring Committed by Jeremiah Senkpiel
Browse files

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: default avatarTrevor Norris <trev.norris@gmail.com>
Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
parent 341b3d01
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment