From f5f88359572d5ced8d20d348eef7b69496a75f1f Mon Sep 17 00:00:00 2001 From: BoB13-Matter Date: Mon, 23 Dec 2024 14:34:40 +0900 Subject: [PATCH] Compare len instead of buf --- src/lib/support/BufferWriter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); }