diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/script/interpreter.cpp | 3 | ||||
-rw-r--r-- | src/test/getarg_tests.cpp | 3 |
2 files changed, 4 insertions, 2 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 */ diff --git a/src/test/getarg_tests.cpp b/src/test/getarg_tests.cpp index 8cadcdd716..8a984304f4 100644 --- a/src/test/getarg_tests.cpp +++ b/src/test/getarg_tests.cpp @@ -16,7 +16,8 @@ BOOST_AUTO_TEST_SUITE(getarg_tests) static void ResetArgs(const std::string& strArg) { std::vector<std::string> vecArg; - boost::split(vecArg, strArg, boost::is_space(), boost::token_compress_on); + if (strArg.size()) + boost::split(vecArg, strArg, boost::is_space(), boost::token_compress_on); // Insert dummy executable name: vecArg.insert(vecArg.begin(), "testbitcoin"); |