Skip to content

Reject malformed client version numbers - #63

Open
kriss39 wants to merge 1 commit into
ethereum:mainfrom
kriss39:fix-vparser-invalid-version-components
Open

Reject malformed client version numbers#63
kriss39 wants to merge 1 commit into
ethereum:mainfrom
kriss39:fix-vparser-invalid-version-components

Conversation

@kriss39

@kriss39 kriss39 commented Sep 10, 2026

Copy link
Copy Markdown

Summary

Reject malformed client version numbers instead of silently parsing invalid numeric components as zero.

Details

parseVersionNumber previously ignored strconv.Atoi errors, so inputs like v1.bad.3 or v1.10.bad could be partially parsed and counted as valid client versions. It also accepted version strings with too many numeric components.

This change propagates parse failure through the Version.Error flag and adds regression coverage for malformed minor, patch, and extra-component version strings.

Test

GOCACHE=/private/tmp/codex-go-cache go test -count=1 ./pkg/vparser

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants