From: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
To: Mauro Carvalho Chehab <m.chehab@samsung.com>,
Linux Media Mailing List <linux-media@vger.kernel.org>,
Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: Hans Verkuil <hverkuil@xs4all.nl>
Subject: Re: [PATCH] [media] stk1160: warrant a NUL terminated string
Date: Mon, 7 Apr 2014 12:08:46 -0300 [thread overview]
Message-ID: <20140407150846.GA1122@arch.cereza> (raw)
In-Reply-To: <1396878140-22084-1-git-send-email-m.chehab@samsung.com>
On Apr 07, Mauro Carvalho Chehab wrote:
> strncpy() doesn't warrant a NUL terminated string. Use
> strlcpy() instead.
>
> Fixes Coverity bug CID#1195195.
>
> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
> ---
> drivers/media/usb/stk1160/stk1160-ac97.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> 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)
Shame on me.
Acked-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
--
Ezequiel García, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com
prev parent reply other threads:[~2014-04-07 15:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-07 13:42 [PATCH] [media] stk1160: warrant a NUL terminated string Mauro Carvalho Chehab
2014-04-07 13:45 ` Hans Verkuil
2014-04-07 15:08 ` Ezequiel Garcia [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140407150846.GA1122@arch.cereza \
--to=ezequiel.garcia@free-electrons.com \
--cc=hverkuil@xs4all.nl \
--cc=linux-media@vger.kernel.org \
--cc=m.chehab@samsung.com \
--cc=mchehab@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox