mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-20 11:11:24 +00:00
use usb2_desc_foreach() to iterate the USB config descriptor instread of
accessing structures directly to check some invalid descriptors. Pointed by: hps
This commit is contained in:
parent
5bb89930e4
commit
d3947a869c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=189874
@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <dev/usb/usb_process.h>
|
||||
#include <dev/usb/usb_device.h>
|
||||
#include <dev/usb/usb_error.h>
|
||||
#include <dev/usb/usb_parse.h>
|
||||
#include <dev/usb/usb_request.h>
|
||||
|
||||
#include <compat/ndis/pe_var.h>
|
||||
@ -1206,12 +1207,11 @@ USBD_ParseConfigurationDescriptorEx(conf, start, intfnum,
|
||||
int32_t intfsubclass;
|
||||
int32_t intfproto;
|
||||
{
|
||||
char *pos;
|
||||
struct usb2_descriptor *next = NULL;
|
||||
usb_interface_descriptor_t *desc;
|
||||
|
||||
for (pos = start; pos < ((char *)conf + UGETW(conf->wTotalLength));
|
||||
pos += desc->bLength) {
|
||||
desc = (usb_interface_descriptor_t *)pos;
|
||||
while ((next = usb2_desc_foreach(conf, next)) != NULL) {
|
||||
desc = (usb_interface_descriptor_t *)next;
|
||||
if (desc->bDescriptorType != UDESC_INTERFACE)
|
||||
continue;
|
||||
if (!(intfnum == -1 || desc->bInterfaceNumber == intfnum))
|
||||
|
Loading…
Reference in New Issue
Block a user