Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7b479d71 authored by Abhishek Pandit-Subedi's avatar Abhishek Pandit-Subedi
Browse files

floss: Fix slice copy in topshim

The size of the slices must match when copying.

Bug: 196885232
Tag: #floss
Test: Start BT and check class of device
Change-Id: Ib5c6ed10af983aeb8433a2829e0b3c846438f015
parent 4fb2f7ca
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -211,7 +211,8 @@ pub fn ascii_to_string(data: &[u8], length: usize) -> String {

fn u32_from_bytes(item: &[u8]) -> u32 {
    let mut u: [u8; 4] = [0; 4];
    u.copy_from_slice(&item[0..4]);
    let len = std::cmp::min(item.len(), 4);
    u[0..len].copy_from_slice(&item);
    u32::from_ne_bytes(u)
}