From a30c8868328552826286ce45d51c5771ec1a08b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Kopy=C5=9Bci=C5=84ski?= Date: Tue, 1 Aug 2023 13:44:22 +0200 Subject: [PATCH] apps/bttester: copy whole buffer to response of get_attr_val Characteristic values can be long and not fit into single os_mbuf - copy whole chain instead. --- apps/bttester/src/btp_gatt.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/bttester/src/btp_gatt.c b/apps/bttester/src/btp_gatt.c index c96593a3df..1c6320510d 100644 --- a/apps/bttester/src/btp_gatt.c +++ b/apps/bttester/src/btp_gatt.c @@ -1807,8 +1807,8 @@ get_attr_val(const void *cmd, uint16_t cmd_len, rp->att_response = out_att_err; rp->value_length = os_mbuf_len(buf) - sizeof(*rp); - (void)memcpy(rsp, buf->om_data, buf->om_len); - *rsp_len = buf->om_len; + os_mbuf_copydata(buf, 0, os_mbuf_len(buf), rsp); + *rsp_len = os_mbuf_len(buf); goto free; } else { @@ -1825,8 +1825,8 @@ get_attr_val(const void *cmd, uint16_t cmd_len, rp->att_response = out_att_err; rp->value_length = os_mbuf_len(buf) - sizeof(*rp); - (void)memcpy(rsp, buf->om_data, buf->om_len); - *rsp_len = buf->om_len; + os_mbuf_copydata(buf, 0, os_mbuf_len(buf), rsp); + *rsp_len = os_mbuf_len(buf); goto free; }