Skip to content

Uint64 values out of range #1

@jonyoder

Description

@jonyoder

I was testing the version parsing against all current PyPI.org versions, and I ran into some out-of-range version components that are allowed by PyPI.org:

error parsing version: strconv.ParseUint: parsing "20210609131134657401": value out of range
error parsing version: strconv.ParseUint: parsing "9786796767868973145897342348293748973489579438579384579384": value out of range
error parsing version: strconv.ParseUint: parsing "14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664709384460955058223172535940812848111745028410270193852110555964462294895493038196442881097566593": value out of range

I have a working fix that modifies part.Uint64 to use math/big instead of uint64, and it fixes the issue. These changes are on a fork in our codebase.

Would you be interested in these improvements? If so, I can create a pull request here and also in the related aquasecurity/go-version module. Obviously, I would also change the modifications in go-version to add a new part type instead of modifying part.Uint64.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions