Skip to content

Commit

Permalink
Merge branch 'bugfix/fix_a_crash_issue_if_uses_sdio_intf_v3.3.0.0' in…
Browse files Browse the repository at this point in the history
…to 'release/v3.3.0.0'

fix(FCS-1612): Fixed a heap corruption issue when using the sdio interface (v3.3.0.0)

See merge request application/esp-at!1681
  • Loading branch information
xcguang committed Dec 3, 2024
2 parents 554c144 + 18b5cb5 commit bb35b44
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions main/interface/sdio/at_sdio_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,12 @@ static int32_t at_sdio_read_data(uint8_t *data, int32_t len)
}

esp_at_sdio_list_t *p_list = sp_head;
if (len < p_list->left_len) {
memcpy(data + copy_len, p_list->pbuf + p_list->pos, len);
p_list->pos += len;
p_list->left_len -= len;
copy_len += len;
uint32_t to_read_len = len - copy_len;
if (to_read_len < p_list->left_len) {
memcpy(data + copy_len, p_list->pbuf + p_list->pos, to_read_len);
p_list->pos += to_read_len;
p_list->left_len -= to_read_len;
copy_len += to_read_len;
} else {
memcpy(data + copy_len, p_list->pbuf + p_list->pos, p_list->left_len);
p_list->pos += p_list->left_len;
Expand Down

0 comments on commit bb35b44

Please sign in to comment.