diff options
Diffstat (limited to 'src/rpcnet.cpp')
-rw-r--r-- | src/rpcnet.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/rpcnet.cpp b/src/rpcnet.cpp index 9f8dea80b0..99602bd1cf 100644 --- a/src/rpcnet.cpp +++ b/src/rpcnet.cpp @@ -2,9 +2,7 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. - - -#include "bitcoinrpc.h" +#include "rpcserver.h" #include "net.h" #include "netbase.h" #include "protocol.h" @@ -126,7 +124,10 @@ Value getpeerinfo(const Array& params, bool fHelp) if (stats.dPingWait > 0.0) obj.push_back(Pair("pingwait", stats.dPingWait)); obj.push_back(Pair("version", stats.nVersion)); - obj.push_back(Pair("subver", stats.strSubVer)); + // Use the sanitized form of subver here, to avoid tricksy remote peers from + // corrupting or modifiying the JSON output by putting special characters in + // their ver message. + obj.push_back(Pair("subver", stats.cleanSubVer)); obj.push_back(Pair("inbound", stats.fInbound)); obj.push_back(Pair("startingheight", stats.nStartingHeight)); obj.push_back(Pair("banscore", stats.nMisbehavior)); |