Skip to content

Commit 97e93c4

Browse files
Avoid unwrapping max_fragment_size
1 parent dfe0e08 commit 97e93c4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

libwebauthn/src/transport/ble/btleplug/connection.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ impl Connection {
4848
}
4949

5050
let mut cursor = IOCursor::new(max_fragment_length);
51-
let max_fragment_size = cursor.read_u16::<BigEndian>().unwrap() as usize;
51+
let max_fragment_size = cursor
52+
.read_u16::<BigEndian>()
53+
.map_err(|_| Error::OperationFailed)? as usize;
5254
Ok(max_fragment_size)
5355
}
5456

0 commit comments

Comments
 (0)