Cleared UBsan error on non-null pointer use

This commit is contained in:
Jeffrey Walton 2015-07-17 22:53:36 -04:00
parent 8cef820ac8
commit e4ab1cd70c

View File

@ -514,6 +514,7 @@ 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)
{
if(!begin || !length) return length;
if (m_buf+m_total != begin)
memcpy(m_buf+m_total, begin, STDMIN(length, SaturatingSubtract(m_size, m_total)));
m_total += length;