diff --git a/embassy-nrf/src/buffered_uarte.rs b/embassy-nrf/src/buffered_uarte.rs index fc4e9c8d0..c42fa1138 100644 --- a/embassy-nrf/src/buffered_uarte.rs +++ b/embassy-nrf/src/buffered_uarte.rs @@ -216,7 +216,7 @@ impl<'d, U: UarteInstance, T: TimerInstance> embedded_io::asynch::Read for Buffe let data = state.rx.pop_buf(); if !data.is_empty() { trace!(" got {:?} {:?}", data.as_ptr() as u32, data.len()); - let len = data.len().min(data.len()); + let len = data.len().min(buf.len()); buf[..len].copy_from_slice(&data[..len]); state.rx.pop(len); do_pend = true;