gregkh / usbutils

USB utilities for Linux, including lsusb
http://www.linux-usb.org
356 stars 202 forks source link

desc-defs.c: fix possible out-of-bound read #131

Closed lzaoral closed 3 years ago

lzaoral commented 3 years ago

Found by static analysis:

Expression (UAC_FORMAT_TYPE_I << 12) + ARRAY_LEN(audio_data_format_type_i) evaluates to 6 which is the length of the audio_data_format_type_i array. Therefore, if value is set to 6, the condition evaluates to true and ouf-of-bound read could occur.