Skip to content

KeyPath.TryParse accepts invalid paths #1258

@mf-16

Description

@mf-16

The KeyPath.TryParse method in NBitcoin currently accepts certain inputs that I believe should not be accepted:

  1. Multiple Consecutive Slashes: Paths like /1/// are accepted due to the removal of empty values when splitting the path by '/'.

  2. Incorrect Handling of -0: Paths such as /-0/-0/-0 are incorrectly accepted. This happens because KeyPath.TryParse internally calls uint.Parse(), which treats -0 as a valid unsigned integer (0).

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