Fix out-of-bounds check
This commit is contained in:
parent
e9e2ef5fbd
commit
24e5d7d5ae
1 changed files with 2 additions and 1 deletions
|
@ -2443,7 +2443,8 @@ bool AcceptBlock(CBlock& block, CValidationState& state, CDiskBlockPos* dbp)
|
||||||
(TestNet() && CBlockIndex::IsSuperMajority(2, pindexPrev, 51, 100)))
|
(TestNet() && CBlockIndex::IsSuperMajority(2, pindexPrev, 51, 100)))
|
||||||
{
|
{
|
||||||
CScript expect = CScript() << nHeight;
|
CScript expect = CScript() << nHeight;
|
||||||
if (!std::equal(expect.begin(), expect.end(), block.vtx[0].vin[0].scriptSig.begin()))
|
if (block.vtx[0].vin[0].scriptSig.size() < expect.size() ||
|
||||||
|
!std::equal(expect.begin(), expect.end(), block.vtx[0].vin[0].scriptSig.begin()))
|
||||||
return state.DoS(100, error("AcceptBlock() : block height mismatch in coinbase"));
|
return state.DoS(100, error("AcceptBlock() : block height mismatch in coinbase"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue