mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-04 09:59:32 +00:00
ALSA: Limit the fallback card id string size
When no proper id string is given, the driver tries to fall back to copy the proc_root name string via strcpy(), but this might overflow the fixed string size. Let's use strlcpy(). Spotted by coverity CID 139008. Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
75415df8ff
commit
97f44f56ca
1 changed files with 1 additions and 1 deletions
|
@ -597,7 +597,7 @@ static void snd_card_set_id_no_lock(struct snd_card *card, const char *src,
|
|||
/* last resort... */
|
||||
snd_printk(KERN_ERR "unable to set card id (%s)\n", id);
|
||||
if (card->proc_root->name)
|
||||
strcpy(card->id, card->proc_root->name);
|
||||
strlcpy(card->id, card->proc_root->name, sizeof(card->id));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue