Skip to content
This repository has been archived by the owner on Jun 25, 2021. It is now read-only.

Commit

Permalink
fix: handle invalid bootstrap response by retuning error
Browse files Browse the repository at this point in the history
  • Loading branch information
madadam committed Oct 21, 2020
1 parent 4324d36 commit d5ee338
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/routing/bootstrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,11 @@ impl State {
return Ok((elders_info, section_key));
}
BootstrapResponse::Rebootstrap(new_bootstrap_addrs) => {
if new_bootstrap_addrs.is_empty() {
error!("{} Invalid rebootstrap response: missing peers", self.node);
return Err(Error::InvalidMessage);
}

info!(
"{} Bootstrapping redirected to another set of peers: {:?}",
self.node, new_bootstrap_addrs,
Expand Down

0 comments on commit d5ee338

Please sign in to comment.