fuzz: package_rbf crashes after out-of-range memory read #32121

issue maflcko openend this issue on March 22, 2025
  1. maflcko commented at 6:24 am on March 22, 2025: member

    Diff to reproduce (turns UB into a runtime exception):

     0diff --git a/src/test/fuzz/rbf.cpp b/src/test/fuzz/rbf.cpp
     1index 3e5b361186..74099f770d 100644
     2--- a/src/test/fuzz/rbf.cpp
     3+++ b/src/test/fuzz/rbf.cpp
     4@@ -118,7 +118,7 @@ FUZZ_TARGET(package_rbf, .init = initialize_package_rbf)
     5     }
     6     assert(iter <= g_outpoints.size());
     7     replacement_tx->vin.resize(1);
     8-    replacement_tx->vin[0].prevout = g_outpoints[iter++];
     9+    replacement_tx->vin[0].prevout = g_outpoints.at(iter++);
    10     CTransaction replacement_tx_final{*replacement_tx};
    11     auto replacement_entry = ConsumeTxMemPoolEntry(fuzzed_data_provider, replacement_tx_final);
    12     int32_t replacement_vsize = replacement_entry.GetTxSize();
    13@@ -132,7 +132,7 @@ FUZZ_TARGET(package_rbf, .init = initialize_package_rbf)
    14         CMutableTransaction parent;
    15         assert(iter <= g_outpoints.size());
    16         parent.vin.resize(1);
    17-        parent.vin[0].prevout = g_outpoints[iter++];
    18+        parent.vin[0].prevout = g_outpoints.at(iter++);
    19         parent.vout.emplace_back(0, CScript());
    20 
    21         mempool_txs.emplace_back(parent);
    

    Input to reproduce:

    Command to reproduce:

    0$ FUZZ=package_rbf ./bld-cmake/bin/fuzz ./package_rbf.crash.not.txt 
    1
    2terminate called after throwing an instance of 'std::out_of_range'
    3  what():  vector::_M_range_check: __n (which is 10000) >= this->size() (which is 10000)
    
  2. maflcko added this to the milestone 29.0 on Mar 22, 2025
  3. maflcko added the label Tests on Mar 22, 2025
  4. glozow closed this on Mar 25, 2025

  5. glozow referenced this in commit c0b7159de4 on Mar 25, 2025


maflcko

Labels
Tests

Milestone
29.0


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-03-28 15:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me