summaryrefslogtreecommitdiff
path: root/iterhash.cpp
diff options
context:
space:
mode:
authorweidai <weidai11@users.noreply.github.com>2010-08-03 20:28:10 +0000
committerweidai <weidai11@users.noreply.github.com>2010-08-03 20:28:10 +0000
commit79ed03344be6875ea9c78096d3ffe5546391afb5 (patch)
tree3df3c3c44c434984ff088817f72ed4ed3c26fd30 /iterhash.cpp
parent05e42a01d9511f9122c21f615dba142db17f4523 (diff)
downloadcryptopp-git-79ed03344be6875ea9c78096d3ffe5546391afb5.tar.gz
fix memcpy with same src and dest (Peter Klotz)
Diffstat (limited to 'iterhash.cpp')
-rw-r--r--iterhash.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/iterhash.cpp b/iterhash.cpp
index 478950c9..1e31e9fb 100644
--- a/iterhash.cpp
+++ b/iterhash.cpp
@@ -66,7 +66,8 @@ template <class T, class BASE> void IteratedHashBase<T, BASE>::Update(const byte
} while (len >= blockSize);
}
- memcpy(data, input, len);
+ if (len && data != input)
+ memcpy(data, input, len);
}
template <class T, class BASE> byte * IteratedHashBase<T, BASE>::CreateUpdateSpace(size_t &size)