diff options
Diffstat (limited to 'src/rpcnet.cpp')
-rw-r--r-- | src/rpcnet.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/rpcnet.cpp b/src/rpcnet.cpp index 9f8dea80b0..8f0df798b4 100644 --- a/src/rpcnet.cpp +++ b/src/rpcnet.cpp @@ -126,7 +126,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)); |