diff options
| author | Ben Evans <[email protected]> | 2021-07-19 17:45:12 +1000 |
|---|---|---|
| committer | Ben Evans <[email protected]> | 2021-07-19 17:45:12 +1000 |
| commit | cee980c598ce3ff83f2980280d53c906b7bf1b19 (patch) | |
| tree | c58d4e0f98746297f6ada09521b870cc15f8bd0c /src | |
| parent | 21bfd11683c4bb6e0996130bd1061a97d3049121 (diff) | |
Fix for dcd_synopsys driver integer overflow in HS mode (issue #968).
Diffstat (limited to 'src')
| -rw-r--r-- | src/portable/st/synopsys/dcd_synopsys.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/portable/st/synopsys/dcd_synopsys.c b/src/portable/st/synopsys/dcd_synopsys.c index 8a196e061..c15694eba 100644 --- a/src/portable/st/synopsys/dcd_synopsys.c +++ b/src/portable/st/synopsys/dcd_synopsys.c @@ -656,7 +656,7 @@ bool dcd_edpt_xfer (uint8_t rhport, uint8_t ep_addr, uint8_t * buffer, uint16_t } uint16_t num_packets = (total_bytes / xfer->max_size); - uint8_t const short_packet_size = total_bytes % xfer->max_size; + uint16_t const short_packet_size = total_bytes % xfer->max_size; // Zero-size packet is special case. if(short_packet_size > 0 || (total_bytes == 0)) { @@ -687,7 +687,7 @@ bool dcd_edpt_xfer_fifo (uint8_t rhport, uint8_t ep_addr, tu_fifo_t * ff, uint16 xfer->total_len = total_bytes; uint16_t num_packets = (total_bytes / xfer->max_size); - uint8_t const short_packet_size = total_bytes % xfer->max_size; + uint16_t const short_packet_size = total_bytes % xfer->max_size; // Zero-size packet is special case. if(short_packet_size > 0 || (total_bytes == 0)) num_packets++; |
