public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil@xs4all.nl>
To: Mauro Carvalho Chehab <m.chehab@samsung.com>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>,
	Mauro Carvalho Chehab <mchehab@infradead.org>
Subject: Re: [PATCH] [media] stk1160: warrant a NUL terminated string
Date: Mon, 07 Apr 2014 15:45:50 +0200	[thread overview]
Message-ID: <5342AC0E.4050203@xs4all.nl> (raw)
In-Reply-To: <1396878140-22084-1-git-send-email-m.chehab@samsung.com>

On 04/07/2014 03:42 PM, 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>

My good deed for the day:

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>

Regards,

	Hans

> ---
>  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)
> 


  reply	other threads:[~2014-04-07 13:46 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 [this message]
2014-04-07 15:08 ` Ezequiel Garcia

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=5342AC0E.4050203@xs4all.nl \
    --to=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