mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-06 03:36:18 +00:00
Fix out-of-bounds read noticed by Ricardo Correia
Sizeof() returned the size of a pointer instead of the size of the buffer. Fixes issue #1924.
This commit is contained in:
parent
12f341d253
commit
3e72516398
@ -3458,9 +3458,6 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
const char* pszDummy = "\0\0";
|
||||
CScript scriptDummy(std::vector<unsigned char>(pszDummy, pszDummy + sizeof(pszDummy)));
|
||||
|
||||
CBlock* CreateNewBlock(CReserveKey& reservekey)
|
||||
{
|
||||
CBlockIndex* pindexPrev = pindexBest;
|
||||
@ -3692,7 +3689,7 @@ CBlock* CreateNewBlock(CReserveKey& reservekey)
|
||||
pblock->nBits = GetNextWorkRequired(pindexPrev, pblock.get());
|
||||
pblock->nNonce = 0;
|
||||
|
||||
pblock->vtx[0].vin[0].scriptSig = scriptDummy;
|
||||
pblock->vtx[0].vin[0].scriptSig = CScript() << OP_0 << OP_0;
|
||||
CBlockIndex indexDummy(1, 1, *pblock);
|
||||
indexDummy.pprev = pindexPrev;
|
||||
indexDummy.nHeight = pindexPrev->nHeight + 1;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user