Skip to content

Reject malformed client version numbers - #63

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

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

@kriss39

kriss39 commented Oct 2, 2026

Copy link
Copy Markdown
Author

@MariusVanDerWijden gentle ping on this. It's a small vparser fix so versions like v1.bad.3 are flagged as errors instead of being parsed as v1.0.3, with regression tests.

@angaz

angaz commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator

Hi @kriss39, sorry, this repo is not really maintained anymore.

@angaz angaz closed this Oct 2, 2026
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.

3 participants