Skip to content

Commit 218d915

Browse files
[bench] Avoid function call arguments which are pointers to uninitialized values
1 parent 47510ad commit 218d915

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/bench/checkblock.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ static void DeserializeBlockTest(benchmark::State& state)
2222
CDataStream stream((const char*)block_bench::block413567,
2323
(const char*)&block_bench::block413567[sizeof(block_bench::block413567)],
2424
SER_NETWORK, PROTOCOL_VERSION);
25-
char a;
25+
char a = '\0';
2626
stream.write(&a, 1); // Prevent compaction
2727

2828
while (state.KeepRunning()) {
@@ -37,7 +37,7 @@ static void DeserializeAndCheckBlockTest(benchmark::State& state)
3737
CDataStream stream((const char*)block_bench::block413567,
3838
(const char*)&block_bench::block413567[sizeof(block_bench::block413567)],
3939
SER_NETWORK, PROTOCOL_VERSION);
40-
char a;
40+
char a = '\0';
4141
stream.write(&a, 1); // Prevent compaction
4242

4343
Consensus::Params params = Params(CBaseChainParams::MAIN).GetConsensus();

0 commit comments

Comments
 (0)