Avoid dereference-of-casted-pointer

This commit is contained in:
Pieter Wuille 2017-07-07 00:54:42 -07:00
parent 5af6572534
commit 0aadc11fd8
8 changed files with 26 additions and 18 deletions
src/script

View file

@ -1099,7 +1099,7 @@ public:
// Serialize the script
if (nInput != nIn)
// Blank out other inputs' signatures
::Serialize(s, CScriptBase());
::Serialize(s, CScript());
else
SerializeScriptCode(s);
// Serialize the nSequence
@ -1207,7 +1207,7 @@ uint256 SignatureHash(const CScript& scriptCode, const CTransaction& txTo, unsig
// The prevout may already be contained in hashPrevout, and the nSequence
// may already be contain in hashSequence.
ss << txTo.vin[nIn].prevout;
ss << static_cast<const CScriptBase&>(scriptCode);
ss << scriptCode;
ss << amount;
ss << txTo.vin[nIn].nSequence;
// Outputs (none/one/all, depending on flags)