mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 11:10:54 +03:00
Merge branch 'bugfix/fix_bluedroid_ai_review_bugs_20260427' into 'master'
Bugfix/fix bluedroid ai review bugs 20260427 See merge request espressif/esp-idf!48450
This commit is contained in:
@@ -353,7 +353,10 @@ bt_status_t btc_transfer_context(btc_msg_t *msg, void *arg, int arg_len, btc_arg
|
||||
|
||||
memcpy(lmsg, msg, sizeof(btc_msg_t));
|
||||
if (arg) {
|
||||
memset(lmsg->arg, 0x00, arg_len); //important, avoid arg which have no length
|
||||
/* memcpy below covers exactly arg_len bytes, which is the full size of
|
||||
* the destination buffer (it was sized as sizeof(btc_msg_t) + arg_len),
|
||||
* so a prior memset would be redundant. Deep-copy callbacks must only
|
||||
* read fields that were written by the caller-supplied arg. */
|
||||
memcpy(lmsg->arg, arg, arg_len);
|
||||
if (copy_func) {
|
||||
copy_func(lmsg, lmsg->arg, arg);
|
||||
|
||||
Reference in New Issue
Block a user