]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerJiri Slaby <jslaby@suse.cz>
Fri, 15 May 2015 07:10:45 +0000 (09:10 +0200)
commitf04628654e140b8ee8296ace05c322eb60de3cd2
treec072595cb9ff83f61a07ae950a4cff9f8fe5be13
parent3844eb5438e0f0040aac8b92157a69155e1b8923
ALSA: emu10k1: Fix card shortname string buffer overflow

commit d02260824e2cad626fb2a9d62e27006d34b6dedc upstream.

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.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
sound/pci/emu10k1/emu10k1.c
sound/pci/emu10k1/emu10k1_main.c