]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ALSA: au88x0: Use safer strscpy() instead of strcpy()
authorTakashi Iwai <tiwai@suse.de>
Thu, 10 Jul 2025 10:06:31 +0000 (12:06 +0200)
committerTakashi Iwai <tiwai@suse.de>
Fri, 11 Jul 2025 07:53:18 +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-50-tiwai@suse.de
sound/pci/au88x0/au88x0.c
sound/pci/au88x0/au88x0_mixer.c

index fd986247331a4891360e9595d87f6f4db118bda1..de56e83d8e10c2c64bd356288a0f68d72bebcd7c 100644 (file)
@@ -220,7 +220,7 @@ __snd_vortex_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
        snd_vortex_workaround(pci, pcifix[dev]);
 
        // Card details needed in snd_vortex_midi
-       strcpy(card->driver, CARD_NAME_SHORT);
+       strscpy(card->driver, CARD_NAME_SHORT);
        sprintf(card->shortname, "Aureal Vortex %s", CARD_NAME_SHORT);
        sprintf(card->longname, "%s at 0x%lx irq %i",
                card->shortname, chip->io, chip->irq);
@@ -270,7 +270,7 @@ __snd_vortex_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
                snd_vortex_synth_arg_t *arg;
 
                arg = SNDRV_SEQ_DEVICE_ARGPTR(wave);
-               strcpy(wave->name, "Aureal Synth");
+               strscpy(wave->name, "Aureal Synth");
                arg->hwptr = vortex;
                arg->index = 1;
                arg->seq_ports = seq_ports[dev];
index aeba684b8d18216ed1290551273a79ac6b4726fa..00781a7fd28c733d65dd4aebdc4bad4fae2170e8 100644 (file)
@@ -15,7 +15,7 @@ static int remove_ctl(struct snd_card *card, const char *name)
 {
        struct snd_ctl_elem_id id;
        memset(&id, 0, sizeof(id));
-       strcpy(id.name, name);
+       strscpy(id.name, name);
        id.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
        return snd_ctl_remove_id(card, &id);
 }