• Takashi Iwai's avatar
    ALSA: emu10k1: Fix card shortname string buffer overflow · 79f0cbcc
    Takashi Iwai authored
    [ Upstream commit d0226082 ]
    
    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: default avatarTakashi Iwai <tiwai@suse.de>
    Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
    79f0cbcc
emu10k1.c 8.81 KB