Merge feb162d500 into merged_master (Bitcoin PR #14696)

This commit is contained in:
Andrew Poelstra 2020-11-09 21:20:26 +00:00
commit ca7b7f3810
9 changed files with 109 additions and 27 deletions

View file

@ -345,7 +345,7 @@ bool EvalScript(std::vector<std::vector<unsigned char> >& stack, const CScript&
opcode == OP_DIV ||
opcode == OP_MOD
) {
return set_error(serror, SCRIPT_ERR_DISABLED_OPCODE); // Disabled opcodes.
return set_error(serror, SCRIPT_ERR_DISABLED_OPCODE); // Disabled opcodes (CVE-2010-5137).
}
// With SCRIPT_VERIFY_CONST_SCRIPTCODE, OP_CODESEPARATOR in non-segwit script is rejected even in an unexecuted branch
@ -1886,6 +1886,8 @@ bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, const C
return set_error(serror, SCRIPT_ERR_SIG_PUSHONLY);
}
// scriptSig and scriptPubKey must be evaluated sequentially on the same stack
// rather than being simply concatenated (see CVE-2010-5141)
std::vector<std::vector<unsigned char> > stack, stackCopy;
if (!EvalScript(stack, scriptSig, flags, checker, SigVersion::BASE, serror))
// serror is set