fix(NODE-3021): fix a long standing bug in Decimal128.fromString()#458
Merged
dariakp merged 2 commits intomongodb:masterfrom Sep 9, 2021
Merged
fix(NODE-3021): fix a long standing bug in Decimal128.fromString()#458dariakp merged 2 commits intomongodb:masterfrom
dariakp merged 2 commits intomongodb:masterfrom
Conversation
dariakp
requested changes
Sep 8, 2021
Contributor
dariakp
left a comment
There was a problem hiding this comment.
Thank you for submitting this fix, I just have a suggestion for a few more test cases around the leading/trailing zero
nbbeeken
approved these changes
Sep 8, 2021
Contributor
nbbeeken
left a comment
There was a problem hiding this comment.
LGTM including the suggested tests, Thanks again!
Co-authored-by: Daria Pardue <[email protected]>
dariakp
approved these changes
Sep 9, 2021
Contributor
Author
|
Thank you! Hope that you can make a new bson npm release (and also a new mongodb node driver npm release) as soon as possible because this bug is potentially a significant vulnerability especially for financial usages. |
Contributor
|
@tzhuan Yes, we are definitely planning to do a release soon. Thank you again! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fix a long standing bug in
Decimal128.fromString()What changed?
The
representationstring was wrongly used to find the significant digits. Thedigitsarray should be used instead.Note that the v2.0 and v3.0 branches also have this bug.