mirror of
https://github.com/espressif/esp-idf.git
synced 2026-01-14 18:55:43 +00:00
fix(app_trace): prevent possible system crash on uart buffer access
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2017-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -288,10 +288,9 @@ static esp_err_t esp_apptrace_uart_up_buffer_put(esp_apptrace_uart_data_t *hw_da
|
||||
|
||||
static void esp_apptrace_uart_down_buffer_config(esp_apptrace_uart_data_t *hw_data, uint8_t *buf, uint32_t size)
|
||||
{
|
||||
hw_data->down_buffer = (uint8_t *)malloc(size);
|
||||
if (hw_data->down_buffer == NULL){
|
||||
assert(false && "Failed to allocate apptrace uart down buffer!");
|
||||
}
|
||||
assert(buf != NULL && "Down buffer cannot be NULL");
|
||||
|
||||
hw_data->down_buffer = buf;
|
||||
hw_data->down_buffer_size = size;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user