ALSA: usb-audio: Avoid access before bLength check in build_audio_procunit()
authorTakashi Iwai <tiwai@suse.de>
Wed, 19 Dec 2018 11:36:27 +0000 (12:36 +0100)
committerTakashi Iwai <tiwai@suse.de>
Mon, 7 Jan 2019 09:46:26 +0000 (10:46 +0100)
commitf4351a199cc120ff9d59e06d02e8657d08e6cc46
treeb3d38fbd367555c5a905dc37954a4af73dd74bf6
parentbfeffd155283772bbe78c6a05dec7c0128ee500c
ALSA: usb-audio: Avoid access before bLength check in build_audio_procunit()

The parser for the processing unit reads bNrInPins field before the
bLength sanity check, which may lead to an out-of-bound access when a
malformed descriptor is given.  Fix it by assignment after the bLength
check.

Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/mixer.c