Skip to content

Commit

Permalink
Merge #1050
Browse files Browse the repository at this point in the history
1050: NO-TICKET: avoid panicking on handling get responses r=Fraser999 a=Fraser999

This PR removes a couple of `todo!`s which could allow a malformed or more likely malicious message to cause the node to panic.

Co-authored-by: Fraser Hutchison <[email protected]>
  • Loading branch information
bors[bot] and Fraser999 authored Mar 2, 2021
2 parents c90260e + 5e97621 commit b330606
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ lint:

.PHONY: audit
audit:
$(CARGO) audit --ignore RUSTSEC-2020-0123
$(CARGO) audit --ignore RUSTSEC-2020-0123 --ignore RUSTSEC-2020-0146

.PHONY: build-docs-stable-rs
build-docs-stable-rs: $(CRATES_WITH_DOCS_RS_MANIFEST_TABLE)
Expand Down
12 changes: 9 additions & 3 deletions node/src/reactor/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -755,10 +755,16 @@ impl reactor::Reactor for Reactor {
responder: None,
})
}
Tag::Block => todo!("Handle GET block response"),
Tag::BlockByHeight => todo!("Handle GET BlockByHeight response"),
Tag::Block => {
warn!(%sender, "received get block response");
return Effects::new();
}
Tag::BlockByHeight => {
warn!(%sender, "received get block by height response");
return Effects::new();
}
Tag::GossipedAddress => {
warn!("received get request for gossiped-address from {}", sender);
warn!(%sender, "received get request for gossiped-address");
return Effects::new();
}
},
Expand Down

0 comments on commit b330606

Please sign in to comment.