Merge "bus: mhi: Fix potential out-of-bound access"
This commit is contained in:
commit
5be23f2a20
@ -358,7 +358,8 @@ static struct mhi_sat_device *find_sat_dev_by_id(
|
|||||||
static bool mhi_sat_isvalid_header(struct sat_header *hdr, int len)
|
static bool mhi_sat_isvalid_header(struct sat_header *hdr, int len)
|
||||||
{
|
{
|
||||||
/* validate payload size */
|
/* validate payload size */
|
||||||
if (len >= sizeof(*hdr) && (len != hdr->payload_size + sizeof(*hdr)))
|
if ((len < sizeof(*hdr)) ||
|
||||||
|
(len >= sizeof(*hdr) && (len != hdr->payload_size + sizeof(*hdr))))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
/* validate SAT IPC version */
|
/* validate SAT IPC version */
|
||||||
|
Loading…
Reference in New Issue
Block a user