diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2012-10-25 06:12:10 -0700 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2012-10-25 06:12:10 -0700 |
commit | 1f7c5c5a3ec8c06862835f30caffdac0466ca22f (patch) | |
tree | 9ae522f85e45908f540a393a61b65cf6b4e0c15b | |
parent | 7a1786084db43519cff0e7b3e7bc742dede2c731 (diff) | |
parent | 4fbad9124e3a7e644b6226df301ddd73c8395f0b (diff) |
Merge pull request #1926 from laanwj/2012_10_maindummybounds
Fix out-of-bounds read in main (issue #1924)
-rw-r--r-- | src/main.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/main.cpp b/src/main.cpp index 2109a1df10..523b3e06e8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3749,9 +3749,6 @@ public: } }; -const char* pszDummy = "\0\0"; -CScript scriptDummy(std::vector<unsigned char>(pszDummy, pszDummy + sizeof(pszDummy))); - CBlock* CreateNewBlock(CReserveKey& reservekey) { CBlockIndex* pindexPrev = pindexBest; @@ -3985,7 +3982,7 @@ CBlock* CreateNewBlock(CReserveKey& reservekey) pblock->UpdateTime(pindexPrev); 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(*pblock); indexDummy.pprev = pindexPrev; |