]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit4093cbb3d0acdc58d258808eb4028016b75f85c7
tree1d2ba45a6e1e871394b8f2035eece063f38e0a73
parent003376f337f68f34089a3f346b7a4b44e5207414
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