aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2014-09-25 10:20:17 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2014-09-25 10:21:01 +0200
commit29a9d4483e294205561905e207719666d3ccf309 (patch)
treec86e301b80909f8e56d8d7806da95c8ff1ccf42a /src
parent58d4b232840ee52e67f73eda6c6bd3cc22355b37 (diff)
parentc8063b57124600ae4e8e2a65eab402d3c47babe2 (diff)
downloadbitcoin-29a9d4483e294205561905e207719666d3ccf309.tar.xz
Merge pull request #4966
c8063b5 Fixing out of bounds asses error (ENikS)
Diffstat (limited to 'src')
-rw-r--r--src/test/crypto_tests.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/test/crypto_tests.cpp b/src/test/crypto_tests.cpp
index a3eec270ee..68232a2ff1 100644
--- a/src/test/crypto_tests.cpp
+++ b/src/test/crypto_tests.cpp
@@ -32,7 +32,7 @@ void TestVector(const Hasher &h, const In &in, const Out &out) {
size_t len = insecure_rand() % ((in.size() - pos + 1) / 2 + 1);
hasher.Write((unsigned char*)&in[pos], len);
pos += len;
- if (pos > 0 && pos + 2 * out.size() > in.size()) {
+ if (pos > 0 && pos + 2 * out.size() > in.size() && pos < in.size()) {
// Test that writing the rest at once to a copy of a hasher works.
Hasher(hasher).Write((unsigned char*)&in[pos], in.size() - pos).Finalize(&hash[0]);
BOOST_CHECK(hash == out);