Skip to content

Commit 19be26a

Browse files
author
MarcoFalke
committed
Merge #9555: [test] Avoid reading a potentially uninitialized variable in tx_invalid-test (transaction_tests.cpp)
8455e36 [test] Avoid reading a potentially uninitialized variable in tx_invalid-test (practicalswift) Tree-SHA512: 1064cdd5c9e4612a05397a5880535d93dbb18dec4897b4bbda9e6ad78d30f4c72303e4d23159398f1b33545ff5819e739e374d7cde757e402b26c355268a2319
2 parents 72fb515 + 8455e36 commit 19be26a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/test/transaction_tests.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,9 @@ BOOST_AUTO_TEST_CASE(tx_invalid)
189189
// verifyFlags is a comma separated list of script verification flags to apply, or "NONE"
190190
UniValue tests = read_json(std::string(json_tests::tx_invalid, json_tests::tx_invalid + sizeof(json_tests::tx_invalid)));
191191

192-
ScriptError err;
192+
// Initialize to SCRIPT_ERR_OK. The tests expect err to be changed to a
193+
// value other than SCRIPT_ERR_OK.
194+
ScriptError err = SCRIPT_ERR_OK;
193195
for (unsigned int idx = 0; idx < tests.size(); idx++) {
194196
UniValue test = tests[idx];
195197
std::string strTest = test.write();

0 commit comments

Comments
 (0)