diff options
| author | hathach <[email protected]> | 2019-10-31 13:06:57 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2019-10-31 13:06:57 +0700 |
| commit | 6de9eb4b1a6bb84832ce4a55f050763d05f8a6b3 (patch) | |
| tree | 855138990a03c204db8db98206815eee2446f0d2 /src | |
| parent | d9ba4d90a8e8e59c111de814acdc7b2cc7ca5bf8 (diff) | |
add more tests, fix an issue with tud_descriptor_configuration_cb() return NULL
Diffstat (limited to 'src')
| -rw-r--r-- | src/device/usbd.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/device/usbd.c b/src/device/usbd.c index 46affdab4..2d2f1cafd 100644 --- a/src/device/usbd.c +++ b/src/device/usbd.c @@ -785,6 +785,8 @@ static bool process_get_descriptor(uint8_t rhport, tusb_control_request_t const case TUSB_DESC_CONFIGURATION:
{
tusb_desc_configuration_t const* desc_config = (tusb_desc_configuration_t const*) tud_descriptor_configuration_cb(desc_index);
+ TU_ASSERT(desc_config);
+
uint16_t total_len;
memcpy(&total_len, &desc_config->wTotalLength, 2); // possibly mis-aligned memory
|
