diff options
| author | Dario Nieuwenhuis <[email protected]> | 2024-08-02 22:21:23 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-08-02 22:21:23 +0000 |
| commit | 03b8e36532427377aa01ea7dedaa97a9540e7d26 (patch) | |
| tree | 7a2c9b6187c779efd1c3f04400becae59fc23850 | |
| parent | a2ea2630f648a9a46dc4f9276d9f5eaf256ae893 (diff) | |
| parent | 7d65c5c4fa9f4a931019625168d7eacf0ec2fa40 (diff) | |
Merge pull request #3226 from embassy-rs/otg-bounds-checks
usb-synopsys-otg: ensure ep alloc fails when endpoint_count < MAX_EP_COUNT.
| -rw-r--r-- | embassy-usb-synopsys-otg/src/lib.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/embassy-usb-synopsys-otg/src/lib.rs b/embassy-usb-synopsys-otg/src/lib.rs index b90e059f6..f155f1522 100644 --- a/embassy-usb-synopsys-otg/src/lib.rs +++ b/embassy-usb-synopsys-otg/src/lib.rs | |||
| @@ -382,8 +382,8 @@ impl<'d, const MAX_EP_COUNT: usize> Driver<'d, MAX_EP_COUNT> { | |||
| 382 | } | 382 | } |
| 383 | 383 | ||
| 384 | let eps = match D::dir() { | 384 | let eps = match D::dir() { |
| 385 | Direction::Out => &mut self.ep_out, | 385 | Direction::Out => &mut self.ep_out[..self.instance.endpoint_count], |
| 386 | Direction::In => &mut self.ep_in, | 386 | Direction::In => &mut self.ep_in[..self.instance.endpoint_count], |
| 387 | }; | 387 | }; |
| 388 | 388 | ||
| 389 | // Find free endpoint slot | 389 | // Find free endpoint slot |
