samples/bluetooth: Fix mis-use of bt_data 'data' field
The data field is a *pointer* to the buffer, not the actual buffer itself. Instead of smashing past the end of the struct, write through that pointer. Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
a2aa462f7d
commit
d61d941ec8
1 changed files with 1 additions and 1 deletions
|
@ -490,7 +490,7 @@ static ssize_t write_adv_data(struct bt_conn *conn,
|
|||
*/
|
||||
slot->ad[2].data_len = MIN(slot->ad[2].data_len,
|
||||
len + EDS_URL_WRITE_OFFSET);
|
||||
memcpy(&slot->ad[2].data + EDS_URL_WRITE_OFFSET, buf,
|
||||
memcpy((uint8_t *) slot->ad[2].data + EDS_URL_WRITE_OFFSET, buf,
|
||||
slot->ad[2].data_len - EDS_URL_WRITE_OFFSET);
|
||||
|
||||
/* Restart slot */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue