diff options
Diffstat (limited to 'src/script')
| -rw-r--r-- | src/script/interpreter.cpp | 3 | ||||
| -rw-r--r-- | src/script/script.h | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp index d742fb9eb..a71f55dd2 100644 --- a/src/script/interpreter.cpp +++ b/src/script/interpreter.cpp @@ -839,7 +839,8 @@ public: itBegin = it; } } - s.write((char*)&itBegin[0], it-itBegin); + if (itBegin != scriptCode.end()) + s.write((char*)&itBegin[0], it-itBegin); } /** Serialize an input of txTo */ diff --git a/src/script/script.h b/src/script/script.h index 4c9ac74b7..caf176476 100644 --- a/src/script/script.h +++ b/src/script/script.h @@ -304,7 +304,7 @@ private: // If the input vector's most significant byte is 0x80, remove it from // the result's msb and return a negative. if (vch.back() & 0x80) - return -(result & ~(0x80ULL << (8 * (vch.size() - 1)))); + return -((int64_t)(result & ~(0x80ULL << (8 * (vch.size() - 1))))); return result; } @@ -544,7 +544,7 @@ public: { while (end() - pc >= (long)b.size() && memcmp(&pc[0], &b[0], b.size()) == 0) { - erase(pc, pc + b.size()); + pc = erase(pc, pc + b.size()); ++nFound; } } |