mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-10-31 18:09:19 +00:00
qdsp6v2: apr: check for packet size to header size comparison
Check if packet size is large enough to hold the header. Change-Id: I7261f8111d8b5f4f7c181e469de248a732242d64 Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
This commit is contained in:
parent
b9cb5f59d9
commit
0177bc3f55
1 changed files with 6 additions and 0 deletions
|
@ -536,6 +536,12 @@ void apr_cb_func(void *buf, int len, void *priv)
|
||||||
pr_err("APR: Wrong paket size\n");
|
pr_err("APR: Wrong paket size\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (hdr->pkt_size < hdr_size) {
|
||||||
|
pr_err("APR: Packet size less than header size\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
msg_type = hdr->hdr_field;
|
msg_type = hdr->hdr_field;
|
||||||
msg_type = (msg_type >> 0x08) & 0x0003;
|
msg_type = (msg_type >> 0x08) & 0x0003;
|
||||||
if (msg_type >= APR_MSG_TYPE_MAX && msg_type != APR_BASIC_RSP_RESULT) {
|
if (msg_type >= APR_MSG_TYPE_MAX && msg_type != APR_BASIC_RSP_RESULT) {
|
||||||
|
|
Loading…
Reference in a new issue