Skip to content

fix: Add range check to signature index#5157

Merged
mversic merged 1 commit intomainfrom
range_check
Oct 22, 2024
Merged

fix: Add range check to signature index#5157
mversic merged 1 commit intomainfrom
range_check

Conversation

@SamHSmith
Copy link
Copy Markdown
Contributor

@SamHSmith SamHSmith commented Oct 17, 2024

Context

The bug is triggered if a a peer is unregistered from the topology while Sumeragi Messages are still in flight. This
is the only place where we use and array index operation that can panic. It is very hard to write a test for this case
that is guaranteed to show the issue each time.

Closes #5104

Solution

  • Describe the approach taken to achieve the objective / resolve the issue.

Migration Guide (optional)

  • If this PR contains a breaking change relative to the main branch, provide an instruction on how affected parties might need to adapt to the change.

Review notes (optional)

  • For complex PRs, try to provide some information on how to approach the review more effectively.
  • For example, is there a natural order in which the affected files should be reviewed?

Checklist

  • I've read CONTRIBUTING.md.
  • (optional) I've written unit tests for the code changes.
  • All review comments have been resolved.
  • All CI checks pass.

@mversic
Copy link
Copy Markdown
Contributor

mversic commented Oct 18, 2024

what's the corresponding issue for this?

@0x009922
Copy link
Copy Markdown
Contributor

Linked it: #5104

Comment thread crates/iroha_core/src/sumeragi/main_loop.rs Outdated
Comment thread crates/iroha_core/src/sumeragi/main_loop.rs Outdated
@mversic mversic requested a review from 0x009922 October 21, 2024 09:22
Signed-off-by: Sam H. Smith <sam.henning.smith@protonmail.com>
@mversic mversic merged commit ae5eb8a into main Oct 22, 2024
@mversic mversic deleted the range_check branch October 22, 2024 07:03
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.

[BUG] Sumeragi panics with "index out of bounds" message after unregistering a peer

3 participants