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

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

Merge "dwc3: debugfs: Add check for length before copy data from userspace"

parents 769a6947 ebcbb527
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -634,7 +634,7 @@ static ssize_t dwc3_store_ep_num(struct file *file, const char __user *ubuf,
	unsigned int		num, dir, temp;
	unsigned long		flags;

	if (copy_from_user(kbuf, ubuf, count > 10 ? 10 : count))
	if (copy_from_user(kbuf, ubuf, min_t(size_t, sizeof(kbuf) - 1, count)))
		return -EFAULT;

	if (sscanf(kbuf, "%u %u", &num, &dir) != 2)