diff options
author | ENikS <evgeni@eniks.com> | 2014-09-23 13:30:27 -0400 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-09-25 11:46:52 +0200 |
commit | 219372f1dd504b0e187da88e3c0adf25a7e6b8d2 (patch) | |
tree | c221e25eb0dffeebbf4bbdb81bf9ee85099843c4 /src/script | |
parent | 35ee2dac6736e23be3fdd584ba0e321e54ff8f61 (diff) |
script: Fix reference into empty vector run time exception
Edit by laanwj: `begin_ptr(sourcedata) + sourcedata.size()` -> `end_ptr(sourcedata)`
Diffstat (limited to 'src/script')
-rw-r--r-- | src/script/interpreter.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp index fd3e4f1ff7..d742fb9eb9 100644 --- a/src/script/interpreter.cpp +++ b/src/script/interpreter.cpp @@ -637,19 +637,19 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, co valtype& vch = stacktop(-1); valtype vchHash((opcode == OP_RIPEMD160 || opcode == OP_SHA1 || opcode == OP_HASH160) ? 20 : 32); if (opcode == OP_RIPEMD160) - CRIPEMD160().Write(&vch[0], vch.size()).Finalize(&vchHash[0]); + CRIPEMD160().Write(begin_ptr(vch), vch.size()).Finalize(begin_ptr(vchHash)); else if (opcode == OP_SHA1) - CSHA1().Write(&vch[0], vch.size()).Finalize(&vchHash[0]); + CSHA1().Write(begin_ptr(vch), vch.size()).Finalize(begin_ptr(vchHash)); else if (opcode == OP_SHA256) - CSHA256().Write(&vch[0], vch.size()).Finalize(&vchHash[0]); + CSHA256().Write(begin_ptr(vch), vch.size()).Finalize(begin_ptr(vchHash)); else if (opcode == OP_HASH160) - CHash160().Write(&vch[0], vch.size()).Finalize(&vchHash[0]); + CHash160().Write(begin_ptr(vch), vch.size()).Finalize(begin_ptr(vchHash)); else if (opcode == OP_HASH256) - CHash256().Write(&vch[0], vch.size()).Finalize(&vchHash[0]); + CHash256().Write(begin_ptr(vch), vch.size()).Finalize(begin_ptr(vchHash)); popstack(stack); stack.push_back(vchHash); } - break; + break; case OP_CODESEPARATOR: { |