Skip to content

Commit bb690c9

Browse files
Dan Carpentertiwai
authored andcommitted
sound: oss: use strlcpy() in sound_timer_init()
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> Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 17d900c commit bb690c9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎sound/oss/sound_timer.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ void sound_timer_init(struct sound_lowlev_timer *t, char *name)
320320
n = sound_alloc_timerdev();
321321
if (n == -1)
322322
n = 0; /* Overwrite the system timer */
323-
strcpy(sound_timer.info.name, name);
323+
strlcpy(sound_timer.info.name, name, sizeof(sound_timer.info.name));
324324
sound_timer_devs[n] = &sound_timer;
325325
}
326326
EXPORT_SYMBOL(sound_timer_init);

0 commit comments

Comments
 (0)