Externals/libusb: Bounds check the interface number

This commit is contained in:
Léo Lam 2019-05-01 17:02:32 +02:00
parent 99b340a6d0
commit 20770fe22b
1 changed files with 3 additions and 0 deletions

View File

@ -2412,6 +2412,9 @@ static int get_valid_interface(struct libusb_device_handle *dev_handle, int api_
*/
static int check_valid_interface(struct libusb_device_handle *dev_handle, unsigned short interface, int api_id)
{
if (interface >= USB_MAXINTERFACES)
return -1;
struct winusb_device_handle_priv *handle_priv = _device_handle_priv(dev_handle);
struct winusb_device_priv *priv = _device_priv(dev_handle->dev);