Commit 0a12a05e authored by Flavio Ceolin's avatar Flavio Ceolin Committed by Maureen Helm
Browse files

ipm: imx: Fix possible buffer overflow

It is possible to happen a buffer overflow in ipm_send due the lack
of a checking for negative value.

Signed-off-by: default avatarFlavio Ceolin <flavio.ceolin@intel.com>
parent 4ff32d92
Loading
Loading
Loading
Loading
+1 −1
Changes for drivers/ipm/ipm_imx.c: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -175,7 +175,7 @@ static int imx_mu_ipm_send(const struct device *dev, int wait, uint32_t id,
		return -EINVAL;
	}

	if (size > CONFIG_IPM_IMX_MAX_DATA_SIZE) {
	if ((size < 0) || (size > CONFIG_IPM_IMX_MAX_DATA_SIZE)) {
		return -EMSGSIZE;
	}