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

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

Merge "diag: dci: Prevent using uninitialized variables"

parents 56b31cdc e9a76aa4
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -2091,6 +2091,11 @@ static int diag_process_dci_pkt_rsp(unsigned char *buf, int len)
	if ((ret == DIAG_DCI_NO_ERROR && !common_cmd) || ret < 0)
		return ret;

	reg_entry.cmd_code = 0;
	reg_entry.subsys_id = 0;
	reg_entry.cmd_code_hi = 0;
	reg_entry.cmd_code_lo = 0;

	if (header_len >= (sizeof(uint8_t)))
		reg_entry.cmd_code = header->cmd_code;
	if (header_len >= (2 * sizeof(uint8_t)))