Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 028704d3 authored by Ajay Agarwal's avatar Ajay Agarwal Committed by Pratham Pratap
Browse files

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: default avatarAjay Agarwal <ajaya@codeaurora.org>
parent 739b514f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment