Skip to content

Commit

Permalink
Compare len instead of buf
Browse files Browse the repository at this point in the history
  • Loading branch information
BoB13-Matter committed Dec 23, 2024
1 parent 57d3b03 commit f5f8835
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/support/BufferWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit f5f8835

Please sign in to comment.