aboutsummaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
authorCory Fields <cory-nospam-@coryfields.com>2014-09-23 16:53:58 -0400
committerCory Fields <cory-nospam-@coryfields.com>2014-09-25 14:56:26 -0400
commitbe6d87aa60c1aca886b557901a493119c2aac024 (patch)
tree080a4fde2b9b3755807c620ecc67e1c7a31f1b0c /src/script
parenta94496fbb672fce43b66f56ed0bbd69a560d5654 (diff)
script: don't read past the end
Diffstat (limited to 'src/script')
-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 d742fb9eb9..a71f55dd26 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 */