Skip to content

Commit

Permalink
Add nullptr check for String TLV data with zero length
Browse files Browse the repository at this point in the history
  • Loading branch information
BoB13-Matter committed Dec 20, 2024
1 parent c1afc02 commit 57d3b03
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)
if (available > 0 && buf != nullptr)
{
memmove(mBuf + mNeeded, buf, available < len ? available : len);
}
Expand Down

0 comments on commit 57d3b03

Please sign in to comment.