diff options
author | Mike Hearn <hearn@google.com> | 2013-11-26 12:52:21 +0100 |
---|---|---|
committer | Mike Hearn <hearn@google.com> | 2013-11-26 13:26:00 +0100 |
commit | a946aa8d3ec7009ac670eeb65a525efe5eeb6e84 (patch) | |
tree | ba5cb18d885ba30c498bdb111f373bfb9812cd20 /src/rpcnet.cpp | |
parent | ba6a4ea344e28d61224dc54a8f816276afa2bfa3 (diff) |
Store and use a sanitized subVer
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)); |