Skip to content

Commit

Permalink
Fix Global Buffer Overflow in AudioOutputManager.cpp (#36858)
Browse files Browse the repository at this point in the history
  • Loading branch information
BoB13-Matter authored Dec 17, 2024
1 parent 4ae6882 commit dbb08f5
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ bool AudioOutputManager::HandleRenameOutput(const uint8_t & index, const chip::C
{
if (output.index == index)
{
if (sizeof(mCharDataBuffer[index]) < name.size())
{
return audioOutputRenamed;
}

audioOutputRenamed = true;
memcpy(this->Data(index), name.data(), name.size());
output.name = chip::CharSpan(this->Data(index), name.size());
Expand Down

0 comments on commit dbb08f5

Please sign in to comment.