Skip to content

Commit d46cd75

Browse files
committed
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: fangzhenwei <[email protected]>
1 parent 366d45f commit d46cd75

File tree

1 file changed

+1
-1
lines changed
  • subsys/bluetooth/host/classic

1 file changed

+1
-1
lines changed

subsys/bluetooth/host/classic/sdp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ static uint32_t search_uuid(struct bt_sdp_data_elem *elem, struct bt_uuid *uuid,
397397
}
398398
} else if (seq_size == 16U) {
399399
u.uuid.type = BT_UUID_TYPE_128;
400-
memcpy(u.u128.val, cur_elem, seq_size);
400+
sys_memcpy_swap(u.u128.val, cur_elem, seq_size);
401401
if (!bt_uuid_cmp(&u.uuid, uuid)) {
402402
*found = true;
403403
}

0 commit comments

Comments
 (0)