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

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

Merge "diag: Prevent out-of-bound read while processing peripheral ctrl_pkt"

parents eb1846d3 791a491e
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -985,6 +985,8 @@ void diag_cntl_process_read_data(struct diagfwd_info *p_info, void *buf,

	while (read_len + header_len < len) {
		ctrl_pkt = (struct diag_ctrl_pkt_header_t *)ptr;
		if ((read_len + header_len + ctrl_pkt->len) > len)
			return;
		switch (ctrl_pkt->pkt_id) {
		case DIAG_CTRL_MSG_REG:
			process_command_registration(ptr, ctrl_pkt->len,