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

Commit 8e354d37 authored by Tharun Raj Soma's avatar Tharun Raj Soma
Browse files

drm/msm/dsi-staging: fix buffer overflow errors



This change fixes the buffer overflow - array index out of bounds
errors by allocating extra space for buf inorder to NULL terminate it.

Change-Id: I9b3f79d049a7a5f617ac74c5d41c416103a6503a
Signed-off-by: default avatarTharun Raj Soma <tsoma@codeaurora.org>
parent 47d149c3
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1302,7 +1302,7 @@ static ssize_t debugfs_esd_trigger_check(struct file *file,
		atomic_read(&display->panel->esd_recovery_pending))
		return user_len;

	buf = kzalloc(user_len, GFP_KERNEL);
	buf = kzalloc(user_len + 1, GFP_KERNEL);
	if (!buf)
		return -ENOMEM;

@@ -1357,7 +1357,7 @@ static ssize_t debugfs_alter_esd_check_mode(struct file *file,
	if (*ppos)
		return 0;

	buf = kzalloc(len, GFP_KERNEL);
	buf = kzalloc(len + 1, GFP_KERNEL);
	if (ZERO_OR_NULL_PTR(buf))
		return -ENOMEM;