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 f0f9e2c
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ CHIP_ERROR EmberAttributeDataBuffer::DecodeAsString(chip::TLV::TLVReader & reade
// data copy
const uint8_t * tlvData;
ReturnErrorOnFailure(reader.GetDataPtr(tlvData));
VerifyOrReturnError(tlvData != nullptr, CHIP_ERROR_INVALID_TLV_ELEMENT);
writer.Put(tlvData, stringLength);

return CHIP_NO_ERROR;
Expand Down

0 comments on commit f0f9e2c

Please sign in to comment.