From 28520e0e05e52501f9e8c3742d3c750e8e4ad70c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Kopy=C5=9Bci=C5=84ski?= Date: Thu, 27 Jul 2023 12:51:03 +0200 Subject: [PATCH] apps/bttester: fix get_attrs response buffer Assigning rsp pointer to new value caused wrong behavior and corrupted response. Data should be copied into buffer instead. --- apps/bttester/src/btp_gatt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/bttester/src/btp_gatt.c b/apps/bttester/src/btp_gatt.c index 72115e21ad..b07caa54fd 100644 --- a/apps/bttester/src/btp_gatt.c +++ b/apps/bttester/src/btp_gatt.c @@ -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; @@ -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;