We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3325f1c commit 4649a71Copy full SHA for 4649a71
drv/auxflash-server/src/main.rs
@@ -252,9 +252,7 @@ impl ServerImpl {
252
let mut read_addr = active_slot_base as usize;
253
// Note: this cannot overflow as spare slot was checked above.
254
let mut write_addr = spare_slot as usize * SLOT_SIZE;
255
- // SAFETY: this cannot overflow as data_size is less or equal to
256
- // SLOT_SIZE and active_slot is valid for reads up to SLOT_SIZE.
257
- let read_end = unsafe { read_addr.unchecked_add(data_size) };
+ let read_end = read_addr + data_size;
258
while read_addr < read_end {
259
let amount = (read_end - read_addr).min(buf.len());
260
0 commit comments