mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-03-16 21:28:33 +03:00
qmod DFU: Don't overwrite memory beyond end of usb_strings[]
The code in board_main_top() for QMOD blindly re-assigned some members of the usb_strings[] array, writing to index 7 and 8. However, that array only has those entries in the main firmware, while in DFU that array has only 6 entries. Depending on whatever the linker has decided to put in the next memory location after that array, we would overwrite that very early during boot-up. Change-Id: I59e4e1a54e819808d5a8259a6d14f4b970a90020 Related: OS#4302
This commit is contained in:
@@ -332,11 +332,13 @@ void board_main_top(void)
|
||||
TRACE_INFO("Detected Quad-Modem ST12\n\r");
|
||||
} else {
|
||||
TRACE_INFO("Detected Quad-Modem ST34\n\r");
|
||||
#ifndef APPLICATION_dfu
|
||||
/* make sure we use the second set of USB Strings
|
||||
* calling the interfaces "Modem 3" and "Modem 4" rather
|
||||
* than 1+2 */
|
||||
usb_strings[7] = usb_strings[9];
|
||||
usb_strings[8] = usb_strings[10];
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Obtain the circuit board version (currently just prints voltage */
|
||||
|
||||
Reference in New Issue
Block a user