aboutsummaryrefslogtreecommitdiff
path: root/src/rpcserver.cpp
diff options
context:
space:
mode:
authorGregory Maxwell <[email protected]>2015-02-08 00:59:58 +0000
committerGregory Maxwell <[email protected]>2015-02-08 19:58:59 +0000
commit28d4cff0ed2d4438da4bbf2d4ca0465715603af5 (patch)
tree052974da2c9aba3e088f4e714f66a0962cda6710 /src/rpcserver.cpp
parentMerge pull request #5721 (diff)
downloaddiscoin-28d4cff0ed2d4438da4bbf2d4ca0465715603af5.tar.xz
discoin-28d4cff0ed2d4438da4bbf2d4ca0465715603af5.zip
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.
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 823b1fcf2..20e9252d7 100644
--- a/src/rpcserver.cpp
+++ b/src/rpcserver.cpp
@@ -849,7 +849,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");