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

Commit ac276656 authored by Shantanu Jain's avatar Shantanu Jain Committed by Gerrit - the friendly Code Review server
Browse files

input: touchscreen: fix buffer overflow issue in synaptics driver



Fix buffer overflow issue in synaptics touch driver while copying
the contents of "strptr" into "firmware_id". This code change is
meant to fix the same.

Change-Id: I8ea96af558eff540a37fb8e7da730c74502622aa
Signed-off-by: default avatarShantanu Jain <shjain@codeaurora.org>
parent 0f89be0e
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -2218,10 +2218,12 @@ static int fwu_get_image_firmware_id(unsigned int *fw_id)
					__func__);
			return -ENOMEM;
		}
		while (strptr[index] >= '0' && strptr[index] <= '9') {
		while ((index < MAX_FIRMWARE_ID_LEN - 1) && strptr[index] >= '0'
						&& strptr[index] <= '9') {
			firmware_id[index] = strptr[index];
			index++;
		}
		firmware_id[index] = '\0';

		retval = sstrtoul(firmware_id, 10, (unsigned long *)fw_id);
		kfree(firmware_id);