Skip to content

Commit

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

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

See merge request application/esp-at!1682
  • Loading branch information
xcguang committed Dec 3, 2024
2 parents b3a0755 + 6b2effc commit ffed417
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions main/interface/sdio/at_sdio_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,13 @@ static int32_t at_sdio_read_data(uint8_t* data, int32_t len)
break;
}

esp_at_sdio_list_t* p_list = pHead;

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;
esp_at_sdio_list_t *p_list = pHead;
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 ffed417

Please sign in to comment.