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

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

Merge "diag: Prevent out-of-bound access while processing mask commands"

parents 58f8ada7 16f99f5f
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2299,6 +2299,8 @@ int diag_process_apps_masks(unsigned char *buf, int len, int pid)
		return -EINVAL;

	if (*buf == DIAG_CMD_LOG_CONFIG) {
		if (len < (2 * sizeof(int)))
			return -EINVAL;
		sub_cmd = *(int *)(buf + sizeof(int));
		switch (sub_cmd) {
		case DIAG_CMD_OP_LOG_DISABLE:
@@ -2316,6 +2318,8 @@ int diag_process_apps_masks(unsigned char *buf, int len, int pid)
			break;
		}
	} else if (*buf == DIAG_CMD_MSG_CONFIG) {
		if (len < (2 * sizeof(uint8_t)))
			return -EINVAL;
		sub_cmd = *(uint8_t *)(buf + sizeof(uint8_t));
		switch (sub_cmd) {
		case DIAG_CMD_OP_GET_SSID_RANGE: