aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
diff options
context:
space:
mode:
authorGregory Maxwell <greg@xiph.org>2015-02-08 00:59:58 +0000
committerGregory Maxwell <greg@xiph.org>2015-02-08 19:58:59 +0000
commit28d4cff0ed2d4438da4bbf2d4ca0465715603af5 (patch)
tree052974da2c9aba3e088f4e714f66a0962cda6710 /src/net.cpp
parentfb6140b54bad51e3b063dfb005bfde13aca64eb4 (diff)
downloadbitcoin-28d4cff0ed2d4438da4bbf2d4ca0465715603af5.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.
Diffstat (limited to 'src/net.cpp')
-rw-r--r--src/net.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/net.cpp b/src/net.cpp
index e4ab9d706d..3c3666615e 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -1971,7 +1971,7 @@ void CNode::BeginMessage(const char* pszCommand) EXCLUSIVE_LOCK_FUNCTION(cs_vSen
ENTER_CRITICAL_SECTION(cs_vSend);
assert(ssSend.size() == 0);
ssSend << CMessageHeader(pszCommand, 0);
- LogPrint("net", "sending: %s ", pszCommand);
+ LogPrint("net", "sending: %s ", SanitizeString(pszCommand));
}
void CNode::AbortMessage() UNLOCK_FUNCTION(cs_vSend)