Skip to content

Commit

Permalink
apps/bttester: fix get_attrs response buffer
Browse files Browse the repository at this point in the history
Assigning rsp pointer to new value caused wrong behavior and corrupted
response. Data should be copied into buffer instead.
  • Loading branch information
KKopyscinski committed Jul 27, 2023
1 parent 65f32e5 commit 28520e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/bttester/src/btp_gatt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1724,7 +1724,6 @@ get_attrs(const void *cmd, uint16_t cmd_len,
SYS_LOG_DBG("start 0x%04x end 0x%04x", start_handle, end_handle);
}

rp = os_mbuf_extend(buf, sizeof(*rp));
if (!rp) {
status = BTP_STATUS_FAILED;
goto free;
Expand Down Expand Up @@ -1765,6 +1764,7 @@ get_attrs(const void *cmd, uint16_t cmd_len,
}

rp->attrs_count = count;
memcpy(rp->attrs, buf->om_data, buf->om_len);

*rsp_len = sizeof(*rp) + buf->om_len;

Expand Down

0 comments on commit 28520e0

Please sign in to comment.