提交 52d802d6 编写于 作者: H Hans Verkuil 提交者: Mauro Carvalho Chehab

[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: NHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
上级 0385443f
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册