aboutsummaryrefslogtreecommitdiff
path: root/src/alert.cpp
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2013-11-10 17:11:39 -0800
committerGavin Andresen <gavinandresen@gmail.com>2013-11-10 17:11:39 -0800
commit16d5f2c5e0a7276fb2b09d8dd51b7bac2753c4cc (patch)
treee2abbe951c7b5533452ed8459c6bf7539c5caab7 /src/alert.cpp
parent3a6faabecf719633481253a0d2f874494ad126a5 (diff)
parent69aada346f74c978b5d8be59a5d7c79be966ef8c (diff)
downloadbitcoin-16d5f2c5e0a7276fb2b09d8dd51b7bac2753c4cc.tar.xz
Merge pull request #3185 from gavinandresen/reject
Reject p2p message
Diffstat (limited to 'src/alert.cpp')
-rw-r--r--src/alert.cpp10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/alert.cpp b/src/alert.cpp
index b900fe41e5..7f7e59ee10 100644
--- a/src/alert.cpp
+++ b/src/alert.cpp
@@ -241,15 +241,7 @@ bool CAlert::ProcessAlert(bool fThread)
// be safe we first strip anything not in safeChars, then add single quotes around
// the whole string before passing it to the shell:
std::string singleQuote("'");
- // safeChars chosen to allow simple messages/URLs/email addresses, but avoid anything
- // even possibly remotely dangerous like & or >
- std::string safeChars("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890 .,;_/:?@");
- std::string safeStatus;
- for (std::string::size_type i = 0; i < strStatusBar.size(); i++)
- {
- if (safeChars.find(strStatusBar[i]) != std::string::npos)
- safeStatus.push_back(strStatusBar[i]);
- }
+ std::string safeStatus = SanitizeString(strStatusBar);
safeStatus = singleQuote+safeStatus+singleQuote;
boost::replace_all(strCmd, "%s", safeStatus);