0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-03-05 14:06:27 -05:00

Merge bitcoin/bitcoin#26227: [24.x] fuzz: Limit outpoints.size in txorphan target to avoid OOM

fa5752da6a fuzz: Limit outpoints.size in txorphan target to avoid OOM (MacroFake)

Pull request description:

  Identical commit from https://github.com/bitcoin/bitcoin/pull/26216

ACKs for top commit:
  fanquake:
    ACK fa5752da6a

Tree-SHA512: fa9bd1defb71b6bc2c62a6cdec5958576cafa0b41cdfebe11d48dd13505eb4a5e0e1d2ce55c0ed561d2a872dab6bb10bd71d941899b3b0eb0b2c38e6b3691ed5
This commit is contained in:
fanquake 2022-10-02 17:13:59 +01:00
commit 4be489d4d4
No known key found for this signature in database
GPG key ID: 2EEB9F5CC09526C1

View file

@ -45,7 +45,7 @@ FUZZ_TARGET_INIT(txorphan, initialize_orphanage)
// if true, allow duplicate input when constructing tx
const bool duplicate_input = fuzzed_data_provider.ConsumeBool();
LIMITED_WHILE(fuzzed_data_provider.ConsumeBool(), 10 * DEFAULT_MAX_ORPHAN_TRANSACTIONS)
LIMITED_WHILE(outpoints.size() < 200'000 && fuzzed_data_provider.ConsumeBool(), 10 * DEFAULT_MAX_ORPHAN_TRANSACTIONS)
{
// construct transaction
const CTransactionRef tx = [&] {