aboutsummaryrefslogtreecommitdiff
path: root/src/script/interpreter.cpp
diff options
context:
space:
mode:
authorCory Fields <[email protected]>2014-09-23 16:53:58 -0400
committerCory Fields <[email protected]>2014-09-25 14:56:26 -0400
commitbe6d87aa60c1aca886b557901a493119c2aac024 (patch)
tree080a4fde2b9b3755807c620ecc67e1c7a31f1b0c /src/script/interpreter.cpp
parenttests: don't split an empty string (diff)
downloaddiscoin-be6d87aa60c1aca886b557901a493119c2aac024.tar.xz
discoin-be6d87aa60c1aca886b557901a493119c2aac024.zip
script: don't read past the end
Diffstat (limited to 'src/script/interpreter.cpp')
-rw-r--r--src/script/interpreter.cpp3
1 files changed, 2 insertions, 1 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 */