summaryrefslogtreecommitdiff
path: root/lib/mpi/mpi-bit.c
diff options
context:
space:
mode:
authorAjay Agarwal <ajaya@codeaurora.org>2017-10-17 11:28:17 +0530
committerAjay Agarwal <ajaya@codeaurora.org>2017-10-18 13:50:46 +0530
commitd7a59889eb3fae98a75f02a61a35b24a136f84dd (patch)
tree8a587aa38cb2a1d80063cf497c1f371d9c3d6915 /lib/mpi/mpi-bit.c
parent6d08baec3167417c0950132dc231a7ae8e2bc283 (diff)
ALSA: usb-audio: Add length check after string desc copy
It might be possible that negative error code is returned in 'len', when we try to copy USB string desc into the ID name buf of snd_kcontrol instance. But even in that case, we are terminating buf with 0 at the 'len' index, which leads to memory corruption. And for good case where 'len' is non-negative, usb_string func is terminating the buf with 0. Fix this by removing the termination of buf with '0' in the caller function. Change-Id: Ie32d395b0fc91d6c3e1cfdbafb76304e21e40577 Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
Diffstat (limited to 'lib/mpi/mpi-bit.c')
0 files changed, 0 insertions, 0 deletions