Merge branch 'fix/tinyusb/string_desc' into 'master'

tinyusb: Do not access string descriptor array out of boundaries

Closes IDF-6943

See merge request espressif/esp-idf!22497
This commit is contained in:
Jiang Jiang Jian 2023-02-28 22:46:59 +08:00
commit df13918c80
6 changed files with 8 additions and 5 deletions

View File

@ -1,4 +1,4 @@
## IDF Component Manager Manifest File
dependencies:
espressif/esp_tinyusb: "^1"
espressif/esp_tinyusb: "^1.1"
idf: "^5.0"

View File

@ -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,
};

View File

@ -1,4 +1,4 @@
## IDF Component Manager Manifest File
dependencies:
espressif/esp_tinyusb: "^1"
espressif/esp_tinyusb: "^1.1"
idf: "^5.0"

View File

@ -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,
};

View File

@ -1,4 +1,4 @@
## IDF Component Manager Manifest File
dependencies:
espressif/esp_tinyusb: "^1"
espressif/esp_tinyusb: "^1.1"
idf: "^5.0"

View File

@ -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,