Repository navigation
test: fuzz version canonicalization and --fetch metadata paths at their edges - #497
Merged
Merged
Conversation
… in the index path The sparse index path is cut from the first bytes of the crate name, so a lockfile name such as "..ab" or ".00" produced /index/../ab/..ab. Only ASCII crate names (letter first, then letters, digits, - and _) are requested.
Coverage
Go by area
Web by area (lines)
|
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.
Problem
pyversion.CanonicalagainstCompareas a pair, and the version seeds had no int-boundary numbers (9223372036854775807,...808,99999999999999999999,999999999999999999, leading zeros) in the epoch, release, pre, post, dev or local positions.metadataPath(oa check --fetch) had no fuzz target. The cargo sparse-index path is cut from the first bytes of the lockfile's crate name, so a name such as..abor.00produced/repos/r/index/../ab/..aborindex/3/./.00: a dot segment in the request path.Change
FuzzCanonicalgets the boundary seeds; newFuzzCanonicalCompare(two inputs): for valid a, b, equal canonical forms implyCompare == 0, andCompare == 0implies equal forms unless a local label is present (Canonical keeps it, Compare ignores it).FuzzMetadataPathover everylockfile.Kind: eitherok=falseor a path under/repos/<escaped repo>/with no?/#, no control character and no./..segment after unescaping.-,_); other names are not requested.build.shfinds everyfunc FuzzX), so no registration.Tests
New fuzz targets ran 30s each locally with no further finding;
TestMetadataPathCargoNamescovers the fixed names.Checks run
make fmt,golangci-lint run ./pkg/pyversion/... ./internal/oacli/...,go test -short -race ./pkg/pyversion/... ./internal/oacli/...