mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
global: fix some potential out-of-bounds issue
...that found by Coverity Scan
This commit is contained in:
parent
bb2a57dc71
commit
483149e41b
@ -713,8 +713,9 @@ esp_err_t rmt_config(const rmt_config_t *rmt_param)
|
||||
static void IRAM_ATTR rmt_fill_memory(rmt_channel_t channel, const rmt_item32_t *item,
|
||||
uint16_t item_num, uint16_t mem_offset)
|
||||
{
|
||||
volatile uint32_t *to = (volatile uint32_t *)&RMTMEM.chan[channel].data32[mem_offset].val;
|
||||
uint32_t *from = (uint32_t *)item;
|
||||
volatile uint32_t *to = (volatile uint32_t *)&RMTMEM.chan[channel].data32[0].val;
|
||||
to += mem_offset;
|
||||
while (item_num--) {
|
||||
*to++ = *from++;
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ static void esp_ipc_init(void) __attribute__((constructor));
|
||||
|
||||
static void esp_ipc_init(void)
|
||||
{
|
||||
char task_name[15];
|
||||
char task_name[configMAX_TASK_NAME_LEN];
|
||||
|
||||
for (int i = 0; i < portNUM_PROCESSORS; ++i) {
|
||||
snprintf(task_name, sizeof(task_name), "ipc%d", i);
|
||||
|
@ -167,7 +167,7 @@ esp_err_t esp_vfs_register_with_id(const esp_vfs_t *vfs, void *ctx, esp_vfs_id_t
|
||||
|
||||
esp_err_t esp_vfs_unregister_with_id(esp_vfs_id_t vfs_id)
|
||||
{
|
||||
if (vfs_id < 0 || vfs_id >= MAX_FDS || s_vfs[vfs_id] == NULL) {
|
||||
if (vfs_id < 0 || vfs_id >= VFS_MAX_COUNT || s_vfs[vfs_id] == NULL) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
vfs_entry_t* vfs = s_vfs[vfs_id];
|
||||
|
Loading…
x
Reference in New Issue
Block a user