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

Commit 396db6f8 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "diag: Validate query dci event and log mask size properly"

parents fd9568cd 4f2f2cb4
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -688,7 +688,7 @@ int diag_dci_query_log_mask(struct diag_dci_client_tbl *entry,
	byte_mask = 0x01 << (item_num % 8);
	byte_mask = 0x01 << (item_num % 8);
	offset = equip_id * 514;
	offset = equip_id * 514;


	if (offset + byte_index > DCI_LOG_MASK_SIZE) {
	if (offset + byte_index >= DCI_LOG_MASK_SIZE) {
		pr_err("diag: In %s, invalid offset: %d, log_code: %d, byte_index: %d\n",
		pr_err("diag: In %s, invalid offset: %d, log_code: %d, byte_index: %d\n",
				__func__, offset, log_code, byte_index);
				__func__, offset, log_code, byte_index);
		return 0;
		return 0;
@@ -715,7 +715,7 @@ int diag_dci_query_event_mask(struct diag_dci_client_tbl *entry,
	bit_index = event_id % 8;
	bit_index = event_id % 8;
	byte_mask = 0x1 << bit_index;
	byte_mask = 0x1 << bit_index;


	if (byte_index > DCI_EVENT_MASK_SIZE) {
	if (byte_index >= DCI_EVENT_MASK_SIZE) {
		pr_err("diag: In %s, invalid, event_id: %d, byte_index: %d\n",
		pr_err("diag: In %s, invalid, event_id: %d, byte_index: %d\n",
				__func__, event_id, byte_index);
				__func__, event_id, byte_index);
		return 0;
		return 0;