Skip to content

Commit

Permalink
Merge pull request #2757 from div72/setban-fix
Browse files Browse the repository at this point in the history
rpc: fix setban segfault
  • Loading branch information
jamescowens authored Apr 5, 2024
2 parents fe6cfa1 + 055abe2 commit 7847923
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/rpc/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,9 @@ UniValue setban(const UniValue& params, bool fHelp)

if (!isSubnet) {
std::vector<CNetAddr> resolved;
LookupHost(params[0].get_str().c_str(), resolved, 1, false);
netAddr = resolved[0];
if (LookupHost(params[0].get_str().c_str(), resolved, 1, false)) {
netAddr = resolved[0];
}
}
else
LookupSubNet(params[0].get_str().c_str(), subNet);
Expand Down

0 comments on commit 7847923

Please sign in to comment.