forked from bitcoinj/bitcoinj
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Limit initial size of some structures
Limits initial size of these structures: - Inputs and Outputs in Transaction - Transactions in Block - Hashes in PartialMerkleeTree The fix prevents this DoS attack: - Somehow the attacker needs to get a p2p connection to the bitcoinj node. - The attacker sends a tx msg that says the tx contains a trillion inputs (or a similar msg attacking any other of the structures described above). - bitcoinj tries to instantiate an ArrayList with a size of a trillion. OutOfMemoryError and the bitcoinj node is down. Cherry pick bitcoinj@26adf68
- Loading branch information
1 parent
7bd0d36
commit f49faa4
Showing
7 changed files
with
146 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters