Commit 70051cf
ALSA: control-led: use strscpy in set_led_id()
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: a135dfb ("ALSA: led control - add sysfs kcontrol LED marking layer")
Reported-by: [email protected]
Link: https://lore.kernel.org/alsa-devel/[email protected]/
Cc: <[email protected]>
Signed-off-by: Jaroslav Kysela <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>1 parent 291e9da commit 70051cf
1 file changed
+2
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
530 | 530 | | |
531 | 531 | | |
532 | 532 | | |
533 | | - | |
534 | 533 | | |
535 | 534 | | |
536 | 535 | | |
537 | | - | |
538 | | - | |
| 536 | + | |
| 537 | + | |
539 | 538 | | |
540 | 539 | | |
541 | 540 | | |
| |||
0 commit comments