Commit 9870a47
authored
F4: USBD_StrDesc[] size fix
- bug: memory overflow for size values less than 62, in function USBD_GetString().
The array in question (USBD_StrDesc) is followed in memory by 2 fill bytes for the current compile order.
Arduino 1.8.6 compiles the files in different order, so that the USB will not working anymore.
The longest string is 32 bytes long (plus ending zero), and 2 more bytes will be added at the beginning (https://github.com/rogerclarkmelbourne/Arduino_STM32/blob/master/STM32F4/cores/maple/libmaple/usbF4/STM32_USB_Device_Library/Core/src/usbd_req.c#L818-L834).
The last 2 bytes are fill bytes (align 4).1 parent d4b3cd1 commit 9870a47
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
0 commit comments