public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: alsa-devel@alsa-project.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] sound: oss: use strlcpy() in sound_timer_init()
Date: Thu, 29 Sep 2011 06:14:25 +0000	[thread overview]
Message-ID: <s5hk48rc1tq.wl%tiwai@suse.de> (raw)
In-Reply-To: <20110929061048.GC4104@elgon.mountain>

At Thu, 29 Sep 2011 09:10:48 +0300,
Dan Carpenter wrote:
> 
> sound_timer.info.name is a 32 character buffer.  This function only
> has one caller (in sound/oss/ad1848.c) and it passes as 128 character
> buffer as "name".  I don't know if this is a problem in real life,
> and I doubt we're going to add more OSS drivers so it's unlikely to
> become an issue.  But we may as well take care of it.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied now.  Thanks.


Takashi


> diff --git a/sound/oss/sound_timer.c b/sound/oss/sound_timer.c
> index 48cda6c..8021c85 100644
> --- a/sound/oss/sound_timer.c
> +++ b/sound/oss/sound_timer.c
> @@ -320,7 +320,7 @@ void  sound_timer_init(struct sound_lowlev_timer *t, char *name)
>  	n = sound_alloc_timerdev();
>  	if (n = -1)
>  		n = 0;		/* Overwrite the system timer */
> -	strcpy(sound_timer.info.name, name);
> +	strlcpy(sound_timer.info.name, name, sizeof(sound_timer.info.name));
>  	sound_timer_devs[n] = &sound_timer;
>  }
>  EXPORT_SYMBOL(sound_timer_init);
> 

      reply	other threads:[~2011-09-29  6:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-29  6:10 [patch] sound: oss: use strlcpy() in sound_timer_init() Dan Carpenter
2011-09-29  6:14 ` Takashi Iwai [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=s5hk48rc1tq.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.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