Re: [PATCH v3] ALSA: control-led: use strscpy in set_led_id()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 09 Jan 2023 16:12:49 +0100,
Jaroslav Kysela wrote:
> 
> 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: a135dfb5de15 ("ALSA: led control - add sysfs kcontrol LED marking layer")
> Reported-by: yang.yang29@xxxxxxxxxx
> Link: https://lore.kernel.org/alsa-devel/202301091945513559977@xxxxxxxxxx/
> Cc: <stable@xxxxxxxxxxxxxxx>
> Signed-off-by: Jaroslav Kysela <perex@xxxxxxxx>
> 
> v1..v2:
>   - remove min() expression which strips the last char
> v2..v3:
>   - BugLink -> Link
>   - add Fixes tag

Thanks, applied.


Takashi



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux