diff options
| author | Nathaniel Brough <[email protected]> | 2023-01-13 13:37:55 -0800 |
|---|---|---|
| committer | Nathaniel Brough <[email protected]> | 2023-01-13 15:20:32 -0800 |
| commit | 2e47210c1af88b88b6f2d92fe2b6d08117041363 (patch) | |
| tree | 7215930f85dd6fcdb0e92a896f3231b3cc57fe2f /src/device/dcd.h | |
| parent | 8775d55adc7c9b0812b7d593b24518c046dd3d82 (diff) | |
fix: Replace device calls to memcpy with tu_memcpy_s
Introduces a new function tu_memcpy_s, which is effectively
a backport of memcpy_s. The change also refactors calls
to memcpy over to the more secure tu_memcpy_s.
Diffstat (limited to 'src/device/dcd.h')
| -rw-r--r-- | src/device/dcd.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/device/dcd.h b/src/device/dcd.h index c1780f656..3a7e6c5df 100644 --- a/src/device/dcd.h +++ b/src/device/dcd.h @@ -193,7 +193,7 @@ TU_ATTR_ALWAYS_INLINE static inline void dcd_event_bus_reset (uint8_t rhport, t TU_ATTR_ALWAYS_INLINE static inline void dcd_event_setup_received(uint8_t rhport, uint8_t const * setup, bool in_isr) { dcd_event_t event = { .rhport = rhport, .event_id = DCD_EVENT_SETUP_RECEIVED }; - memcpy(&event.setup_received, setup, 8); + memcpy(&event.setup_received, setup, sizeof(tusb_control_request_t)); dcd_event_handler(&event, in_isr); } |
