Skip to content

Re-descend the node stack after prune_path restructures the focus's node - #184

Merged
imlvts merged 1 commit into
Adam-Vandervorst:masterfrom
imlvts:fix/prune-path-redescend
Nov 4, 2026
Merged

imlvts merged 1 commit into
Adam-Vandervorst:masterfrom
imlvts:fix/prune-path-redescend

Conversation

@imlvts

@imlvts imlvts commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

Removing a dangling path can restructure the node above the focus so that the focus key now runs through a child node the stack has not descended into. prune_path left the stack there, so later writes at the focus went into the wrong node:

  • a write could put its key into the parent beside that child: a LineListNode with keys "\0" and "\0\0\0", which the node validator rejects as an ambiguous path (found by crash_fuzz);
  • graft_masked_branches below a zipper root that survives as a dangling path merged the branches into the node above the focus, two bytes too shallow (a debug build trips the consumed-bytes assertion). Descend again after pruning.

Removing a dangling path can restructure the node above the focus so that
the focus key now runs through a child node the stack has not descended
into.  prune_path left the stack there, so later writes at the focus went
into the wrong node:
- a write could put its key into the parent beside that child: a
  LineListNode with keys "\0" and "\0\0\0", which the node validator
  rejects as an ambiguous path (found by crash_fuzz);
- graft_masked_branches below a zipper root that survives as a dangling
  path merged the branches into the node above the focus, two bytes too
  shallow (a debug build trips the consumed-bytes assertion).
Descend again after pruning.
@Adam-Vandervorst

Copy link
Copy Markdown
Owner

LGTM

@imlvts
imlvts merged commit e6644eb into Adam-Vandervorst:master Nov 4, 2026
5 checks passed
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