Skip to content

fix(types): nil voteset panics in rest handler - #609

Merged
lklimek merged 1 commit into
v0.12-devfrom
fix-nil-voteset-panic
Apr 3, 2023
Merged

lklimek merged 1 commit into
v0.12-devfrom
fix-nil-voteset-panic

Conversation

@lklimek

@lklimek lklimek commented Apr 3, 2023

Copy link
Copy Markdown
Collaborator

Issue being fixed or feature implemented

In some conditions, accessing REST endpoint like dump_consensus_state causes panic due to access to NIL VoteSet to obtain lock.

Example:
curl 127.0.0.1:36657/dump_consensus_state runtime error: invalid memory address or nil pointer dereference

What was done?

Check nil VoteSet before accessing the lock.

How Has This Been Tested?

Added unit tests

Breaking Changes

None

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

@shotonoff shotonoff left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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