ALSA: emu10k1: Fix card shortname string buffer overflow
authorTakashi Iwai <tiwai@suse.de>
Mon, 27 Apr 2015 11:00:09 +0000 (13:00 +0200)
committerTakashi Iwai <tiwai@suse.de>
Mon, 27 Apr 2015 11:00:09 +0000 (13:00 +0200)
commitd02260824e2cad626fb2a9d62e27006d34b6dedc
tree1d2ba45a6e1e871394b8f2035eece063f38e0a73
parent7290006d8c0900c56d8c58428134f02c35109d17
ALSA: emu10k1: Fix card shortname string buffer overflow

Some models provide too long string for the shortname that has 32bytes
including the terminator, and it results in a non-terminated string
exposed to the user-space.  This isn't too critical, though, as the
string is stopped at the succeeding longname string.

This patch fixes such entries by dropping "SB" prefix (it's enough to
fit within 32 bytes, so far).  Meanwhile, it also changes strcpy()
with strlcpy() to make sure that this kind of problem won't happen in
future, too.

Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/emu10k1/emu10k1.c
sound/pci/emu10k1/emu10k1_main.c