]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ALSA: pdaudiocf: Use safer strscpy() instead of strcpy()
authorTakashi Iwai <tiwai@suse.de>
Thu, 10 Jul 2025 10:07:10 +0000 (12:07 +0200)
committerTakashi Iwai <tiwai@suse.de>
Fri, 11 Jul 2025 07:53:35 +0000 (09:53 +0200)
Use a safer function strscpy() instead of strcpy() for copying to
arrays.

Only idiomatic code replacement, and no functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250710100727.22653-89-tiwai@suse.de
sound/pcmcia/pdaudiocf/pdaudiocf.c
sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c

index 4944607466146821d8b7120dee6db17b5c557d4b..13419837dfb7cedf07328015d70e53c8285c63d8 100644 (file)
@@ -160,7 +160,7 @@ static int snd_pdacf_assign_resources(struct snd_pdacf *pdacf, int port, int irq
        if (err < 0)
                return err;     
 
-       strcpy(card->driver, "PDAudio-CF");
+       strscpy(card->driver, "PDAudio-CF");
        sprintf(card->shortname, "Core Sound %s", card->driver);
        sprintf(card->longname, "%s at 0x%x, irq %i",
                card->shortname, port, irq);
index aaa82ec36540d0b7bfec6ca897d990d09ec03143..20aba745f1dcdfed6702d4dbdbb44fd82936094c 100644 (file)
@@ -263,7 +263,7 @@ int snd_pdacf_pcm_new(struct snd_pdacf *chip)
        pcm->private_data = chip;
        pcm->info_flags = 0;
        pcm->nonatomic = true;
-       strcpy(pcm->name, chip->card->shortname);
+       strscpy(pcm->name, chip->card->shortname);
        chip->pcm = pcm;
        
        err = snd_ak4117_build(chip->ak4117, pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream);