mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-03 03:31:41 +03:00
fix(ledc): add error check for potential out-of-bounds read
This commit is contained in:
@@ -475,7 +475,7 @@ esp_err_t ledc_set_fade_with_time(ledc_mode_t speed_mode, ledc_channel_t channel
|
||||
* - ESP_OK Success
|
||||
* - ESP_ERR_INVALID_ARG Intr flag error
|
||||
* - ESP_ERR_NOT_FOUND Failed to find available interrupt source
|
||||
* - ESP_ERR_INVALID_STATE Fade function already installed
|
||||
* - ESP_ERR_INVALID_STATE Fade function already installed / LEDC not initialized
|
||||
*/
|
||||
esp_err_t ledc_fade_func_install(int intr_alloc_flags);
|
||||
|
||||
|
||||
@@ -1578,6 +1578,7 @@ esp_err_t ledc_fade_func_install(int intr_alloc_flags)
|
||||
break;
|
||||
}
|
||||
}
|
||||
LEDC_CHECK(speed_mode < LEDC_SPEED_MODE_MAX, "LEDC not initialized, call ledc_timer_config first", ESP_ERR_INVALID_STATE);
|
||||
|
||||
//OR intr_alloc_flags with ESP_INTR_FLAG_IRAM because the fade isr is in IRAM
|
||||
return esp_intr_alloc_intrstatus(
|
||||
|
||||
Reference in New Issue
Block a user