Commit bea67422 authored by Peter A. Bigot's avatar Peter A. Bigot Committed by Trevor Norris
Browse files

buffer: fix writeInt{B,L}E for some neg values

The algorithm used to convert negative values to hex generates incorrect
values when the low byte(s) of the value are zero because a carried
subtraction is applied prematurely.

Fixes: https://github.com/nodejs/node/issues/3992
PR-URL: https://github.com/nodejs/node/pull/3994


Reviewed-By: default avatarTrevor Norris <trev.norris@gmail.com>
Signed-off-by: default avatarPeter A. Bigot <pab@pabigot.com>
parent e5d97fd9
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