mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 11:10:54 +03:00
fix(bt/bluedroid): fixed buffer overflow in BRSF
This commit is contained in:
@@ -1378,6 +1378,11 @@ void bta_hf_client_at_parse(char *buf, unsigned int len)
|
|||||||
osi_free(tmp_buff);
|
osi_free(tmp_buff);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* prevent buffer overflow in cases where LEN exceeds available buffer space */
|
||||||
|
if (len > BTA_HF_CLIENT_AT_PARSER_MAX_LEN - bta_hf_client_cb.scb.at_cb.offset) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
memcpy(bta_hf_client_cb.scb.at_cb.buf + bta_hf_client_cb.scb.at_cb.offset, buf, len);
|
memcpy(bta_hf_client_cb.scb.at_cb.buf + bta_hf_client_cb.scb.at_cb.offset, buf, len);
|
||||||
bta_hf_client_cb.scb.at_cb.offset += len;
|
bta_hf_client_cb.scb.at_cb.offset += len;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user