Skip to content

ALSA: remove remaining strlcat() users under sound/

Mahad Ibrahim linux-sound lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7ALSA: ump: replace strlcat() with strscpy()sound/core/ump.c+5 -20 replies
2/7ALSA: ac97: replace strlcat() with scnprintf()sound/pci/ac97/ac97_codec.c+4 -40 replies
3/7ALSA: cmipci: replace strlcat() with strscpy()sound/pci/cmipci.c+6 -20 replies
4/7ALSA: caiaq: replace strlcat() with strscpy()sound/usb/caiaq/input.c+3 -20 replies
5/7ALSA: usb-audio: replace strlcat() with append_ctl_name()sound/usb/mixer.c+6 -20 replies
6/7ALSA: hiface: replace strlcat() with scnprintf()sound/usb/hiface/chip.c+2 -20 replies
7/7ALSA: usb-audio: replace strlcat() in longname constructionsound/usb/card.c+17 -100 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/7] ALSA: remove remaining strlcat() users under sound/

strlcat() is deprecated and slated for removal once its remaining users are converted. This series converts the sound/ users outside of ASoC.

Each site is converted to an explicit offset plus a bounded copy:
strscpy() where the appended text has no format specifiers, and scnprintf() where it does or where the resulting length is needed.

After this series the only remaining strlcat() user under sound/ is sound/soc/codecs/wm_adsp_fw_find_test.c, which goes via ASoC.

Build-tested with allmodconfig and boot-tested on x86_64.

The generated strings were checked against the pre-patch code in a userspace harness for empty, whitespace-padded, exact-fit and oversized inputs, and came out identical. No audio hardware was available here, so the drivers themselves have not been exercised at runtime.

Mahad Ibrahim (7):
ALSA: ump: replace strlcat() with strscpy()
ALSA: ac97: replace strlcat() with scnprintf()
ALSA: cmipci: replace strlcat() with strscpy()
ALSA: caiaq: replace strlcat() with strscpy()
ALSA: usb-audio: replace strlcat() with append_ctl_name()
ALSA: hiface: replace strlcat() with scnprintf()
ALSA: usb-audio: replace strlcat() in longname construction

 sound/core/ump.c            |  7 +++++--
 sound/pci/ac97/ac97_codec.c |  8 ++++----
 sound/pci/cmipci.c          |  8 ++++++--
 sound/usb/caiaq/input.c     |  5 +++--
 sound/usb/card.c            | 27 +++++++++++++++++----------
 sound/usb/hiface/chip.c     |  4 ++--
 sound/usb/mixer.c           |  8 ++++++--
 7 files changed, 43 insertions(+), 24 deletions(-)
Signature · 1 line
2.54.0