Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bb690c9e authored by Dan Carpenter's avatar Dan Carpenter Committed by Takashi Iwai
Browse files

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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 17d900c4
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -320,7 +320,7 @@ void sound_timer_init(struct sound_lowlev_timer *t, char *name)
	n = sound_alloc_timerdev();
	n = sound_alloc_timerdev();
	if (n == -1)
	if (n == -1)
		n = 0;		/* Overwrite the system timer */
		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;
	sound_timer_devs[n] = &sound_timer;
}
}
EXPORT_SYMBOL(sound_timer_init);
EXPORT_SYMBOL(sound_timer_init);