* [patch] sound: oss: use strlcpy() in sound_timer_init()
@ 2011-09-29 6:10 Dan Carpenter
2011-09-29 6:14 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2011-09-29 6:10 UTC (permalink / raw)
To: Jaroslav Kysela; +Cc: Takashi Iwai, alsa-devel, kernel-janitors
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>
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);
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [patch] sound: oss: use strlcpy() in sound_timer_init()
2011-09-29 6:10 [patch] sound: oss: use strlcpy() in sound_timer_init() Dan Carpenter
@ 2011-09-29 6:14 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2011-09-29 6:14 UTC (permalink / raw)
To: Dan Carpenter; +Cc: alsa-devel, kernel-janitors
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);
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-09-29 6:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-29 6:10 [patch] sound: oss: use strlcpy() in sound_timer_init() Dan Carpenter
2011-09-29 6:14 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox