mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
tinyusb: Do not access string descriptor array out of boundaries
The previous version of esp_tinyusb (v1.0.0) always assumed 8 string descriptors.
In case the user passed a smaller array of descriptors,
esp_tinyusb accessed memory outside of the array.
This is fixed esp_tinyusb v1.1.0 by 046cc4b02f
This commit is contained in:
parent
0d97eeb7a5
commit
2b5caf34b7
@ -1,4 +1,4 @@
|
||||
## IDF Component Manager Manifest File
|
||||
dependencies:
|
||||
espressif/esp_tinyusb: "^1"
|
||||
espressif/esp_tinyusb: "^1.1"
|
||||
idf: "^5.0"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
*/
|
||||
@ -167,6 +167,7 @@ void app_main(void)
|
||||
const tinyusb_config_t tusb_cfg = {
|
||||
.device_descriptor = NULL,
|
||||
.string_descriptor = hid_string_descriptor,
|
||||
.string_descriptor_count = sizeof(hid_string_descriptor) / sizeof(hid_string_descriptor[0]),
|
||||
.external_phy = false,
|
||||
.configuration_descriptor = hid_configuration_descriptor,
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
## IDF Component Manager Manifest File
|
||||
dependencies:
|
||||
espressif/esp_tinyusb: "^1"
|
||||
espressif/esp_tinyusb: "^1.1"
|
||||
idf: "^5.0"
|
||||
|
@ -3,7 +3,7 @@
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* SPDX-FileContributor: 2022 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileContributor: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
@ -137,6 +137,7 @@ void app_main(void)
|
||||
tinyusb_config_t const tusb_cfg = {
|
||||
.device_descriptor = NULL, // If device_descriptor is NULL, tinyusb_driver_install() will use Kconfig
|
||||
.string_descriptor = s_str_desc,
|
||||
.string_descriptor_count = sizeof(s_str_desc) / sizeof(s_str_desc[0]),
|
||||
.external_phy = false,
|
||||
.configuration_descriptor = s_midi_cfg_desc,
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
## IDF Component Manager Manifest File
|
||||
dependencies:
|
||||
espressif/esp_tinyusb: "^1"
|
||||
espressif/esp_tinyusb: "^1.1"
|
||||
idf: "^5.0"
|
||||
|
@ -482,6 +482,7 @@ void app_main(void)
|
||||
const tinyusb_config_t tusb_cfg = {
|
||||
.device_descriptor = &descriptor_config,
|
||||
.string_descriptor = string_desc_arr,
|
||||
.string_descriptor_count = sizeof(string_desc_arr) / sizeof(string_desc_arr[0]),
|
||||
.external_phy = false,
|
||||
.configuration_descriptor = desc_configuration,
|
||||
.self_powered = true,
|
||||
|
Loading…
x
Reference in New Issue
Block a user