From fce1938a24d5a5f71ad30bb5e2b4c42c379a976c Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Wed, 28 Dec 2016 14:10:06 +0200 Subject: [PATCH] Bluetooth: Fix another incorrect memcpy call This should also have been net_buf_add_mem(). Otherwise the buffer gets corrupted. Change-Id: I4687584777f446d398182c3e8c2cde5946987da4 Signed-off-by: Johan Hedberg --- subsys/bluetooth/host/conn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index 6f0a415d537..cc12c540051 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -957,7 +957,7 @@ static struct net_buf *create_frag(struct bt_conn *conn, struct net_buf *buf) frag_len = min(conn_mtu(conn), net_buf_tailroom(frag)); - memcpy(frag, buf->data, frag_len); + net_buf_add_mem(frag, buf->data, frag_len); net_buf_pull(buf, frag_len); return frag;