Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 86768220 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "diag: dci: Add missing length check before parsing the buffer"

parents cce3743c 63fa4c6e
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1949,7 +1949,9 @@ static int diag_process_dci_pkt_rsp(unsigned char *buf, int len)
	if (!buf)
		return -EIO;

	if (len <= sizeof(struct dci_pkt_req_t) || len > DCI_REQ_BUF_SIZE) {
	if (len <= (sizeof(struct dci_pkt_req_t) +
		sizeof(struct diag_pkt_header_t)) ||
		len > DCI_REQ_BUF_SIZE) {
		pr_err("diag: dci: Invalid length %d len in %s\n",
			len, __func__);
		return -EIO;