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

Commit b6ee30a2 authored by Barry Song's avatar Barry Song Committed by Greg Kroah-Hartman
Browse files

Staging: iio-utils: fix memory overflow for dynamically allocateded memory to hold filename

parent c3dee74f
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -62,9 +62,8 @@ inline int find_type_by_name(const char *name, const char *type)
					1) != 0) {
				filename = malloc(strlen(iio_dir)
						+ strlen(type)
						+ 1
						+ numstrlen
						+ 1);
						+ 6);
				if (filename == NULL)
					return -ENOMEM;
				sprintf(filename, "%s%s%d/name",