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

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

Merge "usb: gadget: limit the input string size in fsg_show_file"

parents 6288d107 ff2a610b
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -632,6 +632,9 @@ static ssize_t fsg_show_file(struct device *dev, struct device_attribute *attr,
			rc = PTR_ERR(p);
		else {
			rc = strlen(p);
			if (rc > PAGE_SIZE - 2)
				rc = PAGE_SIZE - 2;

			memmove(buf, p, rc);
			buf[rc] = '\n';		/* Add a newline */
			buf[++rc] = 0;