mirror of
https://github.com/espressif/esp-idf.git
synced 2026-08-18 06:35:35 +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);
|
||||
}
|
||||
|
||||
/* 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);
|
||||
bta_hf_client_cb.scb.at_cb.offset += len;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user