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

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

Merge "fbdev: check size before copying the userdata"

parents 83bf68d2 694b0c11
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -201,6 +201,8 @@ int fb_cmap_to_user(const struct fb_cmap *from, struct fb_cmap_user *to)
	if (size > (int) (from->len - fromoff))
		size = from->len - fromoff;
	size *= sizeof(u16);
	if (!size)
		return -EINVAL;

	if (copy_to_user(to->red+tooff, from->red+fromoff, size))
		return -EFAULT;