git://git.novaco.in
/
novacoin.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
a651f1e
)
Fix memory exhaustion
v0.4.3-nvc
author
alexhz
<balthazar@yandex.ru>
Thu, 20 Jun 2013 17:00:45 +0000 (17:00 +0000)
committer
alexhz
<balthazar@yandex.ru>
Thu, 20 Jun 2013 17:00:45 +0000 (17:00 +0000)
src/main.cpp
patch
|
blob
|
history
diff --git
a/src/main.cpp
b/src/main.cpp
index
2bedf29
..
6e897fd
100644
(file)
--- a/
src/main.cpp
+++ b/
src/main.cpp
@@
-3432,6
+3432,12
@@
bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
CInv inv(MSG_TX, tx.GetHash());
pfrom->AddInventoryKnown(inv);
+ // Truncate messages to the size of the tx in them
+ unsigned int nSize = ::GetSerializeSize(tx,SER_NETWORK, PROTOCOL_VERSION);
+ if (nSize < vMsg.size()){
+ vMsg.resize(nSize);
+ }
+
bool fMissingInputs = false;
if (tx.AcceptToMemoryPool(txdb, true, &fMissingInputs))
{