drivers/usbhost/usbhost_composite.c: The cfgdesc pointer was initialized after the buffer had been advanced, so it was not pointing where it should. The totallen operations at the end of the function ended up overwriting memory belonging to the first copied interface descriptor.
This commit is contained in:
parent
d0c569d7b5
commit
3505cce201
@ -458,13 +458,13 @@ static int usbhost_createconfig(FAR struct usbhost_member_s *member,
|
||||
}
|
||||
|
||||
memcpy(buffer, configdesc, USB_SIZEOF_CFGDESC);
|
||||
cfgdesc = (FAR struct usb_cfgdesc_s *)buffer;
|
||||
cfgsize = USB_SIZEOF_CFGDESC;
|
||||
buffer += USB_SIZEOF_CFGDESC;
|
||||
buflen -= USB_SIZEOF_CFGDESC;
|
||||
|
||||
/* Modify the copied configuration descriptor */
|
||||
|
||||
cfgdesc = (FAR struct usb_cfgdesc_s *)buffer;
|
||||
cfgdesc->len = USB_SIZEOF_CFGDESC;
|
||||
cfgdesc->ninterfaces = member->nifs;
|
||||
|
||||
|
@ -42,30 +42,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <pthread.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Type Declarations
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
Loading…
Reference in New Issue
Block a user