Skip to content

Commit

Permalink
Merge #797: Fix VerifyScript calls in fuzz/script_flags
Browse files Browse the repository at this point in the history
ee068ef Fix VerifyScript calls in fuzz/script_flags (Gregory Sanders)

Pull request description:

  Only is compiled with clang/fuzzer setups I suppose.

Tree-SHA512: 3e4b7a1fc96a684cb1b56565830f9f343a23a77677ddde3b18c86cc18d745bbc98c69bdefe985a0f29b3002f05bfc956d2b2b9b6574a4b48615a89dd70f6e468
  • Loading branch information
instagibbs committed Jan 13, 2020
2 parents f3e8ef2 + ee068ef commit 7754cd3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/test/fuzz/script_flags.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ void test_one_input(std::vector<uint8_t> buffer)
const TransactionSignatureChecker checker{&tx, i, prevout.nValue, txdata};

ScriptError serror;
const bool ret = VerifyScript(tx.vin.at(i).scriptSig, prevout.scriptPubKey, &tx.vin.at(i).scriptWitness, verify_flags, checker, &serror);
const bool ret = VerifyScript(tx.vin.at(i).scriptSig, prevout.scriptPubKey, &tx.witness.vtxinwit.at(i).scriptWitness, verify_flags, checker, &serror);
assert(ret == (serror == SCRIPT_ERR_OK));

// Verify that removing flags from a passing test or adding flags to a failing test does not change the result
Expand All @@ -54,7 +54,7 @@ void test_one_input(std::vector<uint8_t> buffer)
if (!IsValidFlagCombination(verify_flags)) return;

ScriptError serror_fuzzed;
const bool ret_fuzzed = VerifyScript(tx.vin.at(i).scriptSig, prevout.scriptPubKey, &tx.vin.at(i).scriptWitness, verify_flags, checker, &serror_fuzzed);
const bool ret_fuzzed = VerifyScript(tx.vin.at(i).scriptSig, prevout.scriptPubKey, &tx.witness.vtxinwit.at(i).scriptWitness, verify_flags, checker, &serror_fuzzed);
assert(ret_fuzzed == (serror_fuzzed == SCRIPT_ERR_OK));

assert(ret_fuzzed == ret);
Expand Down

0 comments on commit 7754cd3

Please sign in to comment.