diff --git a/src/lib/support/BufferWriter.cpp b/src/lib/support/BufferWriter.cpp index 5bbe5a5e722633..3f9a51fe18b815 100644 --- a/src/lib/support/BufferWriter.cpp +++ b/src/lib/support/BufferWriter.cpp @@ -30,7 +30,7 @@ BufferWriter & BufferWriter::Put(const void * buf, size_t len) { size_t available = Available(); - if (available > 0 && buf != nullptr) + if (available > 0 && len > 0) { memmove(mBuf + mNeeded, buf, available < len ? available : len); }