aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorVenkatesh Srinivas <me@endeavour.zapto.org>2011-08-07 12:19:14 -0400
committerJeff Garzik <jgarzik@pobox.com>2011-08-10 22:42:43 -0400
commit25133bd74b75825e8f2ddf551ca09f4537b73a0f (patch)
tree49c6a1fd6e8dcd8285101976eb1ec75b551c358f /src/main.cpp
parenteb20f3c8f5258076d195176ac589a869a9f24708 (diff)
Use 'unsigned char' rather than 'char' for pchMessageStart.
Regarding https://bitcointalk.org/index.php?topic=28022.0 main.cpp has: "char pchMessageStart[4] = { 0xf9, 0xbe, 0xb4, 0xd9 };" Per discussion on the thread linked, leaving the signedness of pchMessageStart is unsafe for values > 0x80. This patch specifies 'unsigned char' in main.cpp and net.h. Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index b57974f577..4bcb87f614 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1766,7 +1766,7 @@ bool static AlreadyHave(CTxDB& txdb, const CInv& inv)
// The message start string is designed to be unlikely to occur in normal data.
// The characters are rarely used upper ascii, not valid as UTF-8, and produce
// a large 4-byte int at any alignment.
-char pchMessageStart[4] = { 0xf9, 0xbe, 0xb4, 0xd9 };
+unsigned char pchMessageStart[4] = { 0xf9, 0xbe, 0xb4, 0xd9 };
bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)