From dbb08f51b596e58c2622b39b20d454a6e94d04a6 Mon Sep 17 00:00:00 2001 From: BoB13-Matter Date: Wed, 18 Dec 2024 03:27:00 +0900 Subject: [PATCH] Fix Global Buffer Overflow in AudioOutputManager.cpp (#36858) --- .../tv-common/clusters/audio-output/AudioOutputManager.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/tv-app/tv-common/clusters/audio-output/AudioOutputManager.cpp b/examples/tv-app/tv-common/clusters/audio-output/AudioOutputManager.cpp index 77a1e2111b44be..4a2a1a0609c448 100644 --- a/examples/tv-app/tv-common/clusters/audio-output/AudioOutputManager.cpp +++ b/examples/tv-app/tv-common/clusters/audio-output/AudioOutputManager.cpp @@ -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());