What changed, and why it matters
This commit removes unused global pointer variables in three test-only fuzzing files. It is a code cleanup change to silence compiler warnings and has no effect on the live Bitcoin Core software that users run.
No security action needed. This is a routine cleanup commit in test-only fuzz harnesses.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change deletes unused g_setup pointers (BasicTestingSetup* and TestingSetup*) from deserialize.cpp, mini_miner.cpp, and crypter.cpp fuzz harnesses. The pointers were assigned during initialization but never read. The static testing_setup object is retained, so test setup behavior is unchanged. The diff is purely subtractive and only touches fuzz test code.
Changed components
src/test/fuzz/deserialize.cppsrc/test/fuzz/mini_miner.cppsrc/wallet/test/fuzz/crypter.cppInspect captured patch +1 / −10
diff --git a/src/test/fuzz/deserialize.cpp b/src/test/fuzz/deserialize.cpp
index 70cad07d..1329f471 100644
--- a/src/test/fuzz/deserialize.cpp
+++ b/src/test/fuzz/deserialize.cpp
@@ -38,18 +38,13 @@
using kernel::CBlockFileInfo;
using node::SnapshotMetadata;
-namespace {
-const BasicTestingSetup* g_setup;
-} // namespace
-
void initialize_deserialize()
{
static const auto testing_setup = MakeNoLogFileContext<>();
- g_setup = testing_setup.get();
}
#define FUZZ_TARGET_DESERIALIZE(name, code) \
- FUZZ_TARGET(name, .init = initialize_deserialize) \
+ FUZZ_TARGET(name, .init = initialize_deserialize) \
{ \
try { \
code \
diff --git a/src/test/fuzz/mini_miner.cpp b/src/test/fuzz/mini_miner.cpp
index eca0caf9..77f9e682 100644
--- a/src/test/fuzz/mini_miner.cpp
+++ b/src/test/fuzz/mini_miner.cpp
@@ -27,12 +27,10 @@
namespace {
-const TestingSetup* g_setup;
std::deque<COutPoint> g_available_coins;
void initialize_miner()
{
static const auto testing_setup = MakeNoLogFileContext<const TestingSetup>();
- g_setup = testing_setup.get();
for (uint32_t i = 0; i < uint32_t{100}; ++i) {
g_available_coins.emplace_back(Txid::FromUint256(uint256::ZERO), i);
}
diff --git a/src/wallet/test/fuzz/crypter.cpp b/src/wallet/test/fuzz/crypter.cpp
index f8f59354..81f82403 100644
--- a/src/wallet/test/fuzz/crypter.cpp
+++ b/src/wallet/test/fuzz/crypter.cpp
@@ -11,11 +11,9 @@
namespace wallet {
namespace {
-const TestingSetup* g_setup;
void initialize_crypter()
{
static const auto testing_setup = MakeNoLogFileContext<const TestingSetup>();
- g_setup = testing_setup.get();
}
FUZZ_TARGET(crypter, .init = initialize_crypter)
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.