mirror of
https://github.com/torvalds/linux.git
synced 2024-11-12 15:11:50 +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
@ -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 New Issue
Block a user