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

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

Merge "fbdev: msm: check buffer size before writing to user buffer"

parents d3b0b056 2940fe8f
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -683,6 +683,11 @@ static ssize_t mdss_xlog_dump_read(struct file *file, char __user *buff,

	if (__mdss_xlog_dump_calc_range()) {
		len = mdss_xlog_dump_entry(xlog_buf, MDSS_XLOG_BUF_MAX);
		if (len < 0 || len > count) {
			pr_err("len is more than the size of user buffer\n");
			return 0;
		}

		if (copy_to_user(buff, xlog_buf, len))
			return -EFAULT;
		*ppos += len;