From: Mauro Carvalho Chehab Date: Mon, 7 Apr 2014 13:39:23 +0000 (-0300) Subject: [media] stk1160: warrant a NUL terminated string X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9b2c06a4f91ce23141c58fbecb064235c06d699f;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [media] stk1160: warrant a NUL terminated string strncpy() doesn't warrant a NUL terminated string. Use strlcpy() instead. Fixes Coverity bug CID#1195195. Acked-by: Ezequiel Garcia Acked-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/usb/stk1160/stk1160-ac97.c b/drivers/media/usb/stk1160/stk1160-ac97.c index c46c8be89602..2dd308f9541f 100644 --- a/drivers/media/usb/stk1160/stk1160-ac97.c +++ b/drivers/media/usb/stk1160/stk1160-ac97.c @@ -108,7 +108,7 @@ int stk1160_ac97_register(struct stk1160 *dev) "stk1160-mixer"); snprintf(card->longname, sizeof(card->longname), "stk1160 ac97 codec mixer control"); - strncpy(card->driver, dev->dev->driver->name, sizeof(card->driver)); + strlcpy(card->driver, dev->dev->driver->name, sizeof(card->driver)); rc = snd_ac97_bus(card, 0, &stk1160_ac97_ops, NULL, &ac97_bus); if (rc)