From: Lars Op den Kamp Date: Fri, 11 Nov 2011 22:52:47 +0000 (+0100) Subject: cec: check whether the initiator is valid in CCECProcessor::ParseCommand(). fixes... X-Git-Tag: upstream/2.2.0~1^2~45^2~4 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=3557c68d1c9f4ce0191163a4ab48b6c5cec68488;p=deb_libcec.git cec: check whether the initiator is valid in CCECProcessor::ParseCommand(). fixes possible segfault when parsing invalid data --- diff --git a/src/lib/CECProcessor.cpp b/src/lib/CECProcessor.cpp index bdcb4d3..cc8d86e 100644 --- a/src/lib/CECProcessor.cpp +++ b/src/lib/CECProcessor.cpp @@ -659,7 +659,7 @@ void CCECProcessor::ParseCommand(cec_command &command) dataStr.AppendFormat(":%02x", (unsigned int)command.parameters[iPtr]); m_controller->AddLog(CEC_LOG_TRAFFIC, dataStr.c_str()); - if (!m_bMonitor) + if (!m_bMonitor && command.initiator >= CECDEVICE_TV && command.initiator < CECDEVICE_BROADCAST) m_busDevices[(uint8_t)command.initiator]->HandleCommand(command); }