Skip to content

Commit

Permalink
Fix memory exhaustion
Browse files Browse the repository at this point in the history
  • Loading branch information
CryptoManiac committed Jun 20, 2013
1 parent a651f1e commit 5a4c7d3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
{
Expand Down

0 comments on commit 5a4c7d3

Please sign in to comment.