summaryrefslogtreecommitdiff
path: root/iterhash.cpp
diff options
context:
space:
mode:
authorweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2010-08-03 20:28:10 +0000
committerweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2010-08-03 20:28:10 +0000
commit2b1577950ce6e9cfd3bdd1007260d0dd90ca2003 (patch)
tree3df3c3c44c434984ff088817f72ed4ed3c26fd30 /iterhash.cpp
parent33be6846c06ec935180c97fa9811758368b5f097 (diff)
downloadcryptopp-2b1577950ce6e9cfd3bdd1007260d0dd90ca2003.tar.gz
fix memcpy with same src and dest (Peter Klotz)
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@514 57ff6487-cd31-0410-9ec3-f628ee90f5f0
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 478950c..1e31e9f 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)