Skip to content
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

fix the bug that causes the crash due to the wrong format of the PeerID #470

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/braft/cli_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,11 @@ butil::Status CliServiceImpl::get_node(scoped_refptr<NodeImpl>* node,
const GroupId& group_id,
const std::string& peer_id) {
if (!peer_id.empty()) {
*node = global_node_manager->get(group_id, peer_id);
PeerId peer;
if (peer.parse(peer_id) != 0) {
return butil::Status(EINVAL, "Fail to parse %s", peer_id.c_str());
}
*node = global_node_manager->get(group_id, peer);
if (!(*node)) {
return butil::Status(ENOENT, "Fail to find node %s in group %s",
peer_id.c_str(),
Expand Down