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

Commit 4312e3a6 authored by Ravikanth Tuniki's avatar Ravikanth Tuniki
Browse files

input: touchscreen: nt36xxx: Check buffer size



Correct buffer size by adding sizeof() to avoid buffer
overflow.

Change-Id: I82b23b7446f90fc4cf94ef3189a5eeeac4366676
Signed-off-by: default avatarRavikanth Tuniki <rtunik@codeaurora.org>
parent 94732056
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -1054,7 +1054,7 @@ const struct seq_operations nvt_selftest_seq_ops = {
static int32_t nvt_selftest_open(struct inode *inode, struct file *file)
static int32_t nvt_selftest_open(struct inode *inode, struct file *file)
{
{
	struct device_node *np = ts->client->dev.of_node;
	struct device_node *np = ts->client->dev.of_node;
	unsigned char mpcriteria[32] = {0};	//novatek-mp-criteria-default
	unsigned char mpcriteria[64] = {0};	//novatek-mp-criteria-default


	TestResult_Short = 0;
	TestResult_Short = 0;
	TestResult_Open = 0;
	TestResult_Open = 0;
@@ -1093,7 +1093,8 @@ static int32_t nvt_selftest_open(struct inode *inode, struct file *file)
		 * Ex. nvt_pid = 500A
		 * Ex. nvt_pid = 500A
		 *     mpcriteria = "novatek-mp-criteria-500A"
		 *     mpcriteria = "novatek-mp-criteria-500A"
		 */
		 */
		snprintf(mpcriteria, PAGE_SIZE, "novatek-mp-criteria-%04X", ts->nvt_pid);
		snprintf(mpcriteria, sizeof(mpcriteria),
				"novatek-mp-criteria-%04X", ts->nvt_pid);


		if (nvt_mp_parse_dt(np, mpcriteria)) {
		if (nvt_mp_parse_dt(np, mpcriteria)) {
			mutex_unlock(&ts->lock);
			mutex_unlock(&ts->lock);