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

Commit e57b36c0 authored by Rasmus Villemoes's avatar Rasmus Villemoes Committed by Mauro Carvalho Chehab
Browse files

[media] drivers/media/pci/zoran: avoid fragile snprintf use



Appending to a string by doing snprintf(buf, bufsize, "%s...", buf,
...) is not guaranteed to work.

Signed-off-by: default avatarRasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 9c574ad4
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -116,8 +116,9 @@ videocodec_attach (struct videocodec_master *master)
				goto out_module_put;
			}

			snprintf(codec->name, sizeof(codec->name),
				 "%s[%d]", codec->name, h->attached);
			res = strlen(codec->name);
			snprintf(codec->name + res, sizeof(codec->name) - res,
				 "[%d]", h->attached);
			codec->master_data = master;
			res = codec->setup(codec);
			if (res == 0) {