Skip to content

Commit

Permalink
Fix Global Buffer Overflow in MediaInputManager.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
BoB13-Matter committed Dec 16, 2024
1 parent cfdaf79 commit 6ff0df9
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ bool MediaInputManager::HandleRenameInput(const uint8_t index, const chip::CharS
{
if (input.index == index)
{
if (sizeof(mCharDataBuffer[index]) < name.size())
{
return mediaInputRenamed;
}

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

0 comments on commit 6ff0df9

Please sign in to comment.