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

Commit 108505b1 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 8a7d73cb 8035fa94
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -376,6 +376,9 @@ ssize_t fsg_show_file(struct fsg_lun *curlun, struct rw_semaphore *filesem,
			rc = PTR_ERR(p);
			rc = PTR_ERR(p);
		else {
		else {
			rc = strlen(p);
			rc = strlen(p);
			if (rc > PAGE_SIZE - 2)
				rc = PAGE_SIZE - 2;

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