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());