aboutsummaryrefslogtreecommitdiff
path: root/src/rpcserver.cpp
diff options
context:
space:
mode:
authorGregory Maxwell <greg@xiph.org>2015-02-08 00:59:58 +0000
committerWladimir J. van der Laan <laanwj@gmail.com>2015-02-24 08:40:07 +0100
commit23126a0a09c26486937c18f75f7701b416ee20af (patch)
treed21bf5bafef424ee31978ab7347ac66ba1b08ab2 /src/rpcserver.cpp
parentd148f62e00612fdd9aa44aa1d891b03e131918c8 (diff)
downloadbitcoin-23126a0a09c26486937c18f75f7701b416ee20af.tar.xz
Sanitize command strings before logging them.
Normally bitcoin core does not display any network originated strings without sanitizing or hex encoding. This wasn't done for strcommand in many places. This could be used to play havoc with a terminal displaying the logs, especially with printtoconsole in use. Thanks to Evil-Knievel for reporting this issue. Conflicts: src/main.cpp
Diffstat (limited to 'src/rpcserver.cpp')
-rw-r--r--src/rpcserver.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp
index 6db2b0421f..37e4f48a3d 100644
--- a/src/rpcserver.cpp
+++ b/src/rpcserver.cpp
@@ -820,7 +820,7 @@ void JSONRequest::parse(const Value& valRequest)
throw JSONRPCError(RPC_INVALID_REQUEST, "Method must be a string");
strMethod = valMethod.get_str();
if (strMethod != "getblocktemplate")
- LogPrint("rpc", "ThreadRPCServer method=%s\n", strMethod);
+ LogPrint("rpc", "ThreadRPCServer method=%s\n", SanitizeString(strMethod));
// Parse params
Value valParams = find_value(request, "params");