Skip to content

Commit

Permalink
Merge pull request #3226 from embassy-rs/otg-bounds-checks
Browse files Browse the repository at this point in the history
usb-synopsys-otg: ensure ep alloc fails when endpoint_count < MAX_EP_COUNT.
  • Loading branch information
Dirbaio authored Aug 2, 2024
2 parents a2ea263 + 7d65c5c commit 03b8e36
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions embassy-usb-synopsys-otg/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,8 @@ impl<'d, const MAX_EP_COUNT: usize> Driver<'d, MAX_EP_COUNT> {
}

let eps = match D::dir() {
Direction::Out => &mut self.ep_out,
Direction::In => &mut self.ep_in,
Direction::Out => &mut self.ep_out[..self.instance.endpoint_count],
Direction::In => &mut self.ep_in[..self.instance.endpoint_count],
};

// Find free endpoint slot
Expand Down

0 comments on commit 03b8e36

Please sign in to comment.