chore: improve key parsing logic and fix premature termination issues #2008

pull famouswizard wants to merge 1 commits into bitcoin:master from famouswizard:patch-1 changing 1 files +19 −8
  1. famouswizard commented at 11:26 am on October 18, 2025: none

    fixed several parsing bugs in key handling logic:

    • find_key_end_position: removed '/' from the set of terminating characters. This prevents derivation paths like .../44'/0'/0'/... from being truncated at the first /.
    • parse_key_expressions: implemented proper parenthesis depth tracking for musig(...) expressions instead of stopping at the first ), allowing correct parsing of nested expressions.
    • parse_key_expressions: added boundary checks (key_pos_end < len(descriptor)) before indexing descriptor[key_pos_end] to avoid IndexError at string ends.

    these changes ensure the parser correctly handles complex key expressions and avoids crashes on edge cases.

  2. chore: improve key parsing logic and fix premature termination issues 6c592a0cd3


famouswizard


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bips. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-10-27 15:10 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me