diff --git a/src/nameclaim.cpp b/src/nameclaim.cpp index ebb223d72..52517697f 100644 --- a/src/nameclaim.cpp +++ b/src/nameclaim.cpp @@ -62,6 +62,7 @@ bool DecodeClaimScript(const CScript& scriptIn, int& op, std::vector >& vvchParams, CScript::const_iterator& pc) { + op = -1; opcodetype opcode; if (!scriptIn.GetOp(pc, opcode)) { diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp index fa777da78..c86731df5 100644 --- a/src/script/interpreter.cpp +++ b/src/script/interpreter.cpp @@ -1493,6 +1493,11 @@ bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, const C // scriptSig and scriptPubKey must be evaluated sequentially on the same stack // rather than being simply concatenated (see CVE-2010-5141) + int claimOp; + const CScript& strippedScriptPubKey = StripClaimScriptPrefix(scriptPubKey, claimOp); + if (claimOp >= 0) // lbryum used to violate this rule with an off-by-1 at len == 255 (and its not very important) + flags &= ~SCRIPT_VERIFY_MINIMALDATA; + std::vector > stack, stackCopy; if (!EvalScript(stack, scriptSig, flags, checker, SigVersion::BASE, serror)) // serror is set @@ -1509,8 +1514,6 @@ bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, const C // Bare witness programs - const CScript& strippedScriptPubKey = StripClaimScriptPrefix(scriptPubKey); - int witnessversion; std::vector witnessprogram; if (flags & SCRIPT_VERIFY_WITNESS) {