Adds temporary fix for rcv frame panic issue (#1862)
This commit is contained in:
parent
237804efb6
commit
36ed7bdf14
@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
### Added
|
||||
|
||||
- Added range check to avoid panic when indexing into RX_BUFFER slice
|
||||
|
||||
### Changed
|
||||
|
||||
### Fixed
|
||||
|
||||
@ -391,7 +391,12 @@ fn ZB_MAC() {
|
||||
log::warn!("Receive queue full");
|
||||
}
|
||||
|
||||
let frm = &RX_BUFFER[1..][..RX_BUFFER[0] as usize];
|
||||
let frm = if RX_BUFFER[0] > FRAME_SIZE as u8 {
|
||||
log::warn!("RX_BUFFER[0] {:} is larger than frame size", RX_BUFFER[0]);
|
||||
&RX_BUFFER[1..][..FRAME_SIZE]
|
||||
} else {
|
||||
&RX_BUFFER[1..][..RX_BUFFER[0] as usize]
|
||||
};
|
||||
if will_auto_send_ack(frm) {
|
||||
*STATE.borrow_ref_mut(cs) = Ieee802154State::TxAck;
|
||||
} else if should_send_enhanced_ack(frm) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user