Skip to content

Commit

Permalink
Merge branch 'bugfix/fix_a_crash_issue_if_uses_sdio_intf' into 'master'
Browse files Browse the repository at this point in the history
fix(FCS-1612): Fixed a heap corruption issue when using the sdio interface

See merge request application/esp-at!1674
  • Loading branch information
xcguang committed Nov 25, 2024
2 parents 760e656 + dd9188d commit a2b8ca9
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 a2b8ca9

Please sign in to comment.