diff options
| author | Pieter Wuille <[email protected]> | 2013-08-24 23:22:13 +0200 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2013-08-24 23:22:27 +0200 |
| commit | 24e5d7d5ae735b41beaaa7ef5feed845607c8280 (patch) | |
| tree | c2456e36ff17f3e8e1050b341d8995059cf5f011 /src/main.cpp | |
| parent | Merge pull request #2926 from Diapolo/model_checks (diff) | |
| download | discoin-24e5d7d5ae735b41beaaa7ef5feed845607c8280.tar.xz discoin-24e5d7d5ae735b41beaaa7ef5feed845607c8280.zip | |
Fix out-of-bounds check
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp index bef578a80..24fd1fadb 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2443,7 +2443,8 @@ bool AcceptBlock(CBlock& block, CValidationState& state, CDiskBlockPos* dbp) (TestNet() && CBlockIndex::IsSuperMajority(2, pindexPrev, 51, 100))) { 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")); } } |