From fdb15b205424e71107f18b43553d43691f3d8fb7 Mon Sep 17 00:00:00 2001 From: "Guilherme S. Salustiano" Date: Sat, 10 Feb 2024 08:58:31 +0100 Subject: [PATCH] add comments about buffer unsound --- embassy-nrf/src/radio/ble.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/embassy-nrf/src/radio/ble.rs b/embassy-nrf/src/radio/ble.rs index 7718cfe14..ba9ac5f2e 100644 --- a/embassy-nrf/src/radio/ble.rs +++ b/embassy-nrf/src/radio/ble.rs @@ -334,6 +334,8 @@ impl<'d, T: Instance> Radio<'d, T> { } /// Send packet + /// If the length byte in the package is greater than the buffer length + /// the radio will read memory out of the buffer bounds pub async fn transmit(&mut self, buffer: &[u8]) -> Result<(), Error> { self.set_buffer(buffer)?; @@ -349,6 +351,8 @@ impl<'d, T: Instance> Radio<'d, T> { } /// Receive packet + /// If the length byte in the received package is greater than the buffer length + /// the radio will write memory out of the buffer bounds pub async fn receive(&mut self, buffer: &mut [u8]) -> Result<(), Error> { self.set_buffer(buffer)?;