mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-20 01:20:54 +00:00
[media] cec: add sanity check for msg->len
Check (and warn) if the msg->len is too long or if it is 0. Should never happen, but just in case... Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
This commit is contained in:
parent
0385443fec
commit
52d802d65b
1 changed files with 3 additions and 0 deletions
|
@ -763,6 +763,9 @@ void cec_received_msg(struct cec_adapter *adap, struct cec_msg *msg)
|
|||
bool is_reply = false;
|
||||
bool valid_la = true;
|
||||
|
||||
if (WARN_ON(!msg->len || msg->len > CEC_MAX_MSG_SIZE))
|
||||
return;
|
||||
|
||||
mutex_lock(&adap->lock);
|
||||
msg->ts = ktime_get_ns();
|
||||
msg->rx_status = CEC_RX_STATUS_OK;
|
||||
|
|
Loading…
Reference in a new issue