-
Notifications
You must be signed in to change notification settings - Fork 30.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Buffer.writeInt{L,B}E generates wrong bytes for some negative integers #3992
Labels
buffer
Issues and PRs related to the buffer subsystem.
Comments
pabigot
added a commit
to pabigot/node
that referenced
this issue
Nov 23, 2015
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 nodejs#3992 Signed-off-by: Peter A. Bigot <[email protected]>
pabigot
added a commit
to pabigot/buffer-layout
that referenced
this issue
Nov 23, 2015
The common Buffer.writeInt{L,B}E methods have a bug; if it appears to be present in the running version of node substitute the fixed code. See: nodejs/node#3992
pabigot
added a commit
to pabigot/buffer-layout
that referenced
this issue
Nov 29, 2015
Provide the patch for Node.js issue #3992 as a standalone module. See: nodejs/node#3992
rvagg
pushed a commit
that referenced
this issue
Dec 5, 2015
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: #3992 PR-URL: #3994 Reviewed-By: Trevor Norris <[email protected]> Signed-off-by: Peter A. Bigot <[email protected]>
MylesBorins
pushed a commit
that referenced
this issue
Dec 15, 2015
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: #3992 PR-URL: #3994 Reviewed-By: Trevor Norris <[email protected]> Signed-off-by: Peter A. Bigot <[email protected]>
jasnell
pushed a commit
that referenced
this issue
Dec 17, 2015
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: #3992 PR-URL: #3994 Reviewed-By: Trevor Norris <[email protected]> Signed-off-by: Peter A. Bigot <[email protected]>
jasnell
pushed a commit
that referenced
this issue
Dec 23, 2015
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: #3992 PR-URL: #3994 Reviewed-By: Trevor Norris <[email protected]> Signed-off-by: Peter A. Bigot <[email protected]>
scovetta
pushed a commit
to scovetta/node
that referenced
this issue
Apr 2, 2016
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: nodejs#3992 PR-URL: nodejs#3994 Reviewed-By: Trevor Norris <[email protected]> Signed-off-by: Peter A. Bigot <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The common Buffer implementation for writing integer values uses a rather opaque algorithm that involves carrying a -1 adjustment into high bytes when converting negative integers. The adjustment is improperly applied when lower bytes are zero.
An example:
This bug is present in v0.12.x through HEAD.
Patch incoming.
The text was updated successfully, but these errors were encountered: