Skip to content

Commit dec74c0

Browse files
committed
Merge bitcoin/bitcoin#29657: Bugfix: bitcoin-cli: Check length of peer.transport_protocol_type
c3e632b Bugfix: bitcoin-cli: Check length of peer.transport_protocol_type (Luke Dashjr) Pull request description: "v" would dereference beyond the string length, and "v10" would show as '1' Turn both of these cases into a blank, like anything else unexpected currently is. ACKs for top commit: sipa: utACK c3e632b. hernanmarino: utACK c3e632b alfonsoromanz: ACK c3e632b achow101: ACK c3e632b Tree-SHA512: f641e4412521adae7c8c8e1f268bdaaa223d9048d8286e3df4b13905faaa0d601155ce581cd649f760cab2acc4122356fa94a44714f1f190845552100105eda0
2 parents 3310a96 + c3e632b commit dec74c0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/bitcoin-cli.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ class NetinfoRequestHandler : public BaseRequestHandler
551551
peer.is_outbound ? "out" : "in",
552552
ConnectionTypeForNetinfo(peer.conn_type),
553553
peer.network,
554-
peer.transport_protocol_type.starts_with('v') ? peer.transport_protocol_type[1] : ' ',
554+
(peer.transport_protocol_type.size() == 2 && peer.transport_protocol_type[0] == 'v') ? peer.transport_protocol_type[1] : ' ',
555555
PingTimeToString(peer.min_ping),
556556
PingTimeToString(peer.ping),
557557
peer.last_send ? ToString(time_now - peer.last_send) : "",

0 commit comments

Comments
 (0)