summaryrefslogtreecommitdiff
path: root/filters.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'filters.cpp')
-rw-r--r--filters.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/filters.cpp b/filters.cpp
index 47a91a3..9f4308b 100644
--- a/filters.cpp
+++ b/filters.cpp
@@ -509,7 +509,8 @@ size_t RandomNumberSink::Put2(const byte *begin, size_t length, int messageEnd,
size_t ArraySink::Put2(const byte *begin, size_t length, int messageEnd, bool blocking)
{
- memcpy(m_buf+m_total, begin, STDMIN(length, SaturatingSubtract(m_size, m_total)));
+ if (m_buf+m_total != begin)
+ memcpy(m_buf+m_total, begin, STDMIN(length, SaturatingSubtract(m_size, m_total)));
m_total += length;
return 0;
}