Skip to content

Prevent panic in MerkleTree MultiPath::verify by handling missing leaves #166

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

anim001k
Copy link

@anim001k anim001k commented Aug 9, 2025

Description (Markdown):

  • What: Replace unwrap() in MultiPath::verify with explicit check and return Err(Error::IncorrectInputLength(...)) when the iterator of leaves is shorter than leaf_indexes.len().
  • Why: Avoids potential panic/DoS on malformed or adversarial input; aligns with the function’s Result<bool, Error> contract; consistent with Path::verify behavior.
  • Build: cargo check passes.

@anim001k anim001k requested a review from a team as a code owner August 9, 2025 10:53
@anim001k anim001k requested review from z-tech, Pratyush and mmagician and removed request for a team August 9, 2025 10:53
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.

1 participant