From be6d87aa60c1aca886b557901a493119c2aac024 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 23 Sep 2014 16:53:58 -0400 Subject: [PATCH] script: don't read past the end --- src/script/interpreter.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 */