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

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

Merge "input: synaptics: Add checks of user input data"

parents ee8d6349 ed426d18
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1697,6 +1697,13 @@ static ssize_t fwu_sysfs_store_image(struct file *data_file,
		struct kobject *kobj, struct bin_attribute *attributes,
		char *buf, loff_t pos, size_t count)
{
	if (count > fwu->image_size - fwu->data_pos) {
		dev_err(&fwu->rmi4_data->i2c_client->dev,
				"%s: Not enough space in buffer\n",
				__func__);
		return -EINVAL;
	}

	memcpy((void *)(&fwu->ext_data_source[fwu->data_pos]),
			(const void *)buf,
			count);