From 46bf2753c26132e58fdbf3983167b14683d25ce3 Mon Sep 17 00:00:00 2001 From: zhenwei fang Date: Mon, 23 Jun 2025 10:58:28 +0800 Subject: [PATCH] Bluetooth: Classic: SDP: swap elem data before uuid128 compare SDP transfer multiple-byte fields in byte order big-endian, bt_uuid_128 UUID value, 128-bit in little-endian format. Refer to line 542 of the find_services function. Signed-off-by: zhenwei fang --- subsys/bluetooth/host/classic/sdp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/bluetooth/host/classic/sdp.c b/subsys/bluetooth/host/classic/sdp.c index 80d2468a7ef6..4b74c177f928 100644 --- a/subsys/bluetooth/host/classic/sdp.c +++ b/subsys/bluetooth/host/classic/sdp.c @@ -397,7 +397,7 @@ static uint32_t search_uuid(struct bt_sdp_data_elem *elem, struct bt_uuid *uuid, } } else if (seq_size == 16U) { u.uuid.type = BT_UUID_TYPE_128; - memcpy(u.u128.val, cur_elem, seq_size); + sys_memcpy_swap(u.u128.val, cur_elem, seq_size); if (!bt_uuid_cmp(&u.uuid, uuid)) { *found = true; }