aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2017-03-07 01:21:58 +0100
committerMarcoFalke <falke.marco@gmail.com>2017-03-07 01:22:12 +0100
commit19be26afe3d04783a92d032b55bf3fb1e2ae63cc (patch)
treef7290aeecc2294e88921dfe9ff614a7e4e401a86
parent72fb5158b1c8bd85c2bccc87ba814170a0095d34 (diff)
parent8455e367fe79ff53ea81d283f3435e74b1633c88 (diff)
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
-rw-r--r--src/test/transaction_tests.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp
index 374423179c..3b5da4980b 100644
--- a/src/test/transaction_tests.cpp
+++ b/src/test/transaction_tests.cpp
@@ -189,7 +189,9 @@ BOOST_AUTO_TEST_CASE(tx_invalid)
// verifyFlags is a comma separated list of script verification flags to apply, or "NONE"
UniValue tests = read_json(std::string(json_tests::tx_invalid, json_tests::tx_invalid + sizeof(json_tests::tx_invalid)));
- ScriptError err;
+ // Initialize to SCRIPT_ERR_OK. The tests expect err to be changed to a
+ // value other than SCRIPT_ERR_OK.
+ ScriptError err = SCRIPT_ERR_OK;
for (unsigned int idx = 0; idx < tests.size(); idx++) {
UniValue test = tests[idx];
std::string strTest = test.write();