diff options
author | Mihai Pop <mihai.pop@qorvo.com> | 2024-03-29 15:35:50 +0200 |
---|---|---|
committer | Mathieu Mandret <mathieu.mandret@qorvo.com> | 2024-04-04 16:17:59 +0200 |
commit | 794e34a03355a3dcf79cdf9f6f757b7ed2400a31 (patch) | |
tree | 6144709b522711577db94327f76fc238a004f93f | |
parent | f87d278758a2ee3663d5e167c6aaaa0696acc976 (diff) | |
download | uwb-794e34a03355a3dcf79cdf9f6f757b7ed2400a31.tar.gz |
Fix radar notification parsing
Fix multiplication overflow when sweep data is unpacked for a radar data packet.
Bug: 331804951
Change-Id: Ifc2314f6e58b8e041966da26485b2d44f2ac4634
-rw-r--r-- | src/rust/uwb_core/src/uci/notification.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rust/uwb_core/src/uci/notification.rs b/src/rust/uwb_core/src/uci/notification.rs index 08af530..cab87f7 100644 --- a/src/rust/uwb_core/src/uci/notification.rs +++ b/src/rust/uwb_core/src/uci/notification.rs @@ -284,7 +284,7 @@ fn parse_radar_sweep_data( + UCI_RADAR_TIMESTAMP_LEN + UCI_RADAR_VENDOR_DATA_LEN_LEN + vendor_specific_data_len - + (samples_per_sweep * bytes_per_sample_value) as usize; + + samples_per_sweep as usize * bytes_per_sample_value as usize; if data.len() < sweep_data_cursor + sweep_data_len { error!("Invalid radar sweep data length, data: {:?}", &data); return Err(Error::BadParameters); |