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

Commit aed315f3 authored by Satya Rama Aditya Pinapala's avatar Satya Rama Aditya Pinapala
Browse files

disp: msm: dsi: add check for buffer length before copy



The change adds a check to make sure the length of bytes being
copied don't exceed the size of the destination buffer
causing an overflow.

Change-Id: Ib3ca3705e4179ccda1af11279e96e167baee6a3b
Signed-off-by: default avatarSatya Rama Aditya Pinapala <psraditya30@codeaurora.org>
parent a8974603
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1120,6 +1120,9 @@ static ssize_t debugfs_dump_info_read(struct file *file,
			"\tClock master = %s\n",
			display->ctrl[display->clk_master_idx].ctrl->name);

	if (len > user_len)
		len = user_len;

	if (copy_to_user(user_buf, buf, len)) {
		kfree(buf);
		return -EFAULT;