diff options
author | fanquake <fanquake@gmail.com> | 2022-05-17 16:28:11 +0100 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2022-05-17 16:39:10 +0100 |
commit | d5d40d59f8d12cf53c5ad1ce9710f3f108cec386 (patch) | |
tree | ad08cae3346d85b5548b50da4d6f0a016cb72048 /src | |
parent | dd8a2df488f6fbff7e7863d5278d60f266f8d2f2 (diff) | |
parent | ada8358ef54aaa04c9182afe115d8046c801bdde (diff) |
Merge bitcoin/bitcoin#23679: Sanitize `port` in `addpeeraddress()`
ada8358ef54aaa04c9182afe115d8046c801bdde Sanitize port in `addpeeraddress()` (amadeuszpawlik)
Pull request description:
In connection to #22087, it has been [pointed out](https://github.com/bitcoin/bitcoin/pull/22087#pullrequestreview-674786285) that `addpeeraddress` needs to get its port-value sanitized.
ACKs for top commit:
fanquake:
ACK ada8358ef54aaa04c9182afe115d8046c801bdde
Tree-SHA512: 48771cd4f6940aa7840fa23488565c09dea86bd5ec5a5a1fc0374afb4857aebcd2a1f51e2d4cb7348460e0ad9793dc5d2962df457084ed2b8d8142cae650003f
Diffstat (limited to 'src')
-rw-r--r-- | src/rpc/net.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp index 09dc8eb3eb..ff714eaf36 100644 --- a/src/rpc/net.cpp +++ b/src/rpc/net.cpp @@ -932,7 +932,7 @@ static RPCHelpMan addpeeraddress() } const std::string& addr_string{request.params[0].get_str()}; - const uint16_t port{static_cast<uint16_t>(request.params[1].get_int())}; + const auto port{request.params[1].getInt<uint16_t>()}; const bool tried{request.params[2].isTrue()}; UniValue obj(UniValue::VOBJ); |