WSL2-Linux-Kernel/sound/core
Jaroslav Kysela 9ab3696881 ALSA: control-led: use strscpy in set_led_id()
commit 70051cffb3 upstream.

The use of strncpy() in the set_led_id() was incorrect.
The len variable should use 'min(sizeof(buf2) - 1, count)'
expression.

Use strscpy() function to simplify things and handle the error gracefully.

Fixes: a135dfb5de ("ALSA: led control - add sysfs kcontrol LED marking layer")
Reported-by: yang.yang29@zte.com.cn
Link: https://lore.kernel.org/alsa-devel/202301091945513559977@zte.com.cn/
Cc: <stable@vger.kernel.org>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-18 11:48:46 +01:00
..
oss ALSA: pcm: oss: Fix race at SNDCTL_DSP_SYNC 2022-09-15 11:30:02 +02:00
seq ALSA: seq: Fix function prototype mismatch in snd_seq_expand_var_event 2022-12-14 11:37:16 +01:00
Kconfig
Makefile
compress_offload.c
control.c ALSA: pcm: Move rwsem lock inside snd_ctl_elem_read to prevent UAF 2023-01-14 10:23:28 +01:00
control_compat.c
control_led.c ALSA: control-led: use strscpy in set_led_id() 2023-01-18 11:48:46 +01:00
ctljack.c
device.c
hrtimer.c
hwdep.c
hwdep_compat.c
info.c ALSA: info: Fix llseek return value when using callback 2022-08-25 11:39:53 +02:00
info_oss.c
init.c ALSA: core: Fix double-free at snd_card_new() 2022-09-28 11:11:40 +02:00
isadma.c
jack.c ALSA: jack: Access input_dev under mutex 2022-06-09 10:22:32 +02:00
memalloc.c
memalloc_local.h
memory.c
misc.c ALSA: core: Add async signal helpers 2022-08-25 11:40:44 +02:00
pcm.c
pcm_compat.c
pcm_dmaengine.c ALSA: dmaengine: increment buffer pointer atomically 2022-10-26 12:34:56 +02:00
pcm_drm_eld.c
pcm_iec958.c
pcm_lib.c
pcm_local.h
pcm_memory.c ALSA: pcm: Check for null pointer of pointer substream before dereferencing it 2022-06-09 10:22:49 +02:00
pcm_misc.c
pcm_native.c ALSA: pcm: Set missing stop_operating flag at undoing trigger start 2022-12-31 13:14:16 +01:00
pcm_param_trace.h
pcm_timer.c
pcm_trace.h
rawmidi.c ALSA: rawmidi: Drop register_mutex in snd_rawmidi_free() 2022-10-26 12:34:17 +02:00
rawmidi_compat.c
seq_device.c
sgbuf.c
sound.c
sound_oss.c ALSA: oss: Fix potential deadlock at unregistration 2022-10-26 12:34:17 +02:00
timer.c ALSA: timer: Use deferred fasync helper 2022-08-25 11:40:44 +02:00
timer_compat.c
vmaster.c