apd: prevent NewFromString parsing invalid decimals#145
Merged
mw5h merged 1 commit intocockroachdb:masterfrom Mar 13, 2026
Merged
apd: prevent NewFromString parsing invalid decimals#145mw5h merged 1 commit intocockroachdb:masterfrom
mw5h merged 1 commit intocockroachdb:masterfrom
Conversation
Reject non-digit characters in the mantissa.
mw5h
approved these changes
Mar 13, 2026
Contributor
mw5h
left a comment
There was a problem hiding this comment.
:lgtm:
Thanks for this fix!
mw5h
added a commit
to mw5h/apd
that referenced
this pull request
Mar 13, 2026
- Drop EOL Go versions 1.15–1.18, add Go 1.24 - Bump actions/checkout v2 → v4 - Bump actions/setup-go v2 → v5 - Bump uraimo/run-on-arch-action v2.1.1 → v3 - Update ARM test distro from ubuntu20.04 (EOL) to ubuntu24.04 - Bump GCAssert minimum Go to 1.22 to match matrix The ubuntu20.04 ARM docker images are no longer available, causing CI failures for PRs (e.g. cockroachdb#145). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
mw5h
added a commit
to mw5h/apd
that referenced
this pull request
Mar 13, 2026
- Drop EOL Go versions 1.15–1.18, add Go 1.24 - Bump actions/checkout v2 → v4 - Bump actions/setup-go v2 → v5 - Bump uraimo/run-on-arch-action v2.1.1 → v3 - Update ARM test distro from ubuntu20.04 (EOL) to ubuntu24.04 - Bump GCAssert minimum Go to 1.22 to match matrix The ubuntu20.04 ARM docker images are no longer available, causing CI failures for PRs (e.g. cockroachdb#145). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
mw5h
added a commit
to mw5h/apd
that referenced
this pull request
Mar 13, 2026
- Drop EOL Go versions 1.15–1.18, add Go 1.24 - Bump actions/checkout v2 → v4 - Bump actions/setup-go v2 → v5 - Bump uraimo/run-on-arch-action v2.1.1 → v3 - Update ARM test distro from ubuntu20.04 (EOL) to ubuntu24.04 - Bump GCAssert minimum Go to 1.22 to match matrix The ubuntu20.04 ARM docker images are no longer available, causing CI failures for PRs (e.g. cockroachdb#145). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Fixes a parsing bug outlined in #144 where sign characters (
+,-) immediately after a decimal point bypasssetString's sign validation and are passed tobig.Int.SetString, which accepts them. This produces corruptDecimalvalues.The fix validates that the mantissa contains only ASCII digits (0-9) after the decimal point and exponent have been removed, before it is passed to
big.Int.SetString.Related: #120