From 753bd3420ac67d8cef4c53eaaad561c23b2a0f13 Mon Sep 17 00:00:00 2001 From: Kilani Akrich Date: Fri, 29 Sep 2023 09:34:53 +0100 Subject: [PATCH] [PRJ][APPS][USBH] Fix stack corruption due to inconsistent type of local variable in MSC_File_Operations() --- .../Applications/USB_Host/MSC_Standalone/Src/file_operations.c | 2 +- .../USB_Host/DualCore_Standalone/Src/file_operations.c | 2 +- .../USB_Host/DynamicSwitch_Standalone/Src/file_operations.c | 2 +- .../Applications/USB_Host/FWupgrade_Standalone/Src/command.c | 2 +- .../Applications/USB_Host/MSC_RTOS/Src/file_operations.c | 2 +- .../Applications/USB_Host/MSC_Standalone/Src/file_operations.c | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Projects/NUCLEO-F207ZG/Applications/USB_Host/MSC_Standalone/Src/file_operations.c b/Projects/NUCLEO-F207ZG/Applications/USB_Host/MSC_Standalone/Src/file_operations.c index 284cf2cc..c95b814e 100644 --- a/Projects/NUCLEO-F207ZG/Applications/USB_Host/MSC_Standalone/Src/file_operations.c +++ b/Projects/NUCLEO-F207ZG/Applications/USB_Host/MSC_Standalone/Src/file_operations.c @@ -40,7 +40,7 @@ uint8_t wtext[] = "USB Host Library : Mass Storage Example"; */ void MSC_File_Operations(void) { - uint16_t bytesread; + uint32_t bytesread; LCD_UsrLog("INFO : FatFs Initialized \n"); diff --git a/Projects/STM322xG_EVAL/Applications/USB_Host/DualCore_Standalone/Src/file_operations.c b/Projects/STM322xG_EVAL/Applications/USB_Host/DualCore_Standalone/Src/file_operations.c index 1c14093a..eb50a148 100644 --- a/Projects/STM322xG_EVAL/Applications/USB_Host/DualCore_Standalone/Src/file_operations.c +++ b/Projects/STM322xG_EVAL/Applications/USB_Host/DualCore_Standalone/Src/file_operations.c @@ -40,7 +40,7 @@ uint8_t wtext [] = "USB Host Library : Mass Storage Example"; */ void MSC_File_Operations(void) { - uint16_t bytesread; + uint32_t bytesread; /* Register the file system object to the FatFs module */ if(f_mount(&USBH_fatfs, "", 0) != FR_OK) diff --git a/Projects/STM322xG_EVAL/Applications/USB_Host/DynamicSwitch_Standalone/Src/file_operations.c b/Projects/STM322xG_EVAL/Applications/USB_Host/DynamicSwitch_Standalone/Src/file_operations.c index f9936137..38c4d4e2 100644 --- a/Projects/STM322xG_EVAL/Applications/USB_Host/DynamicSwitch_Standalone/Src/file_operations.c +++ b/Projects/STM322xG_EVAL/Applications/USB_Host/DynamicSwitch_Standalone/Src/file_operations.c @@ -40,7 +40,7 @@ uint8_t wtext [] = "USB Host Library : Mass Storage Example"; */ void MSC_File_Operations(void) { - uint16_t bytesread; + uint32_t bytesread; /* Register the file system object to the FatFs module */ if(f_mount(&USBH_fatfs, "", 0 ) != FR_OK ) diff --git a/Projects/STM322xG_EVAL/Applications/USB_Host/FWupgrade_Standalone/Src/command.c b/Projects/STM322xG_EVAL/Applications/USB_Host/FWupgrade_Standalone/Src/command.c index 769ac7af..e1bbe8c4 100644 --- a/Projects/STM322xG_EVAL/Applications/USB_Host/FWupgrade_Standalone/Src/command.c +++ b/Projects/STM322xG_EVAL/Applications/USB_Host/FWupgrade_Standalone/Src/command.c @@ -192,7 +192,7 @@ static void COMMAND_ProgramFlashMemory(void) { uint32_t programcounter = 0x00; uint8_t readflag = TRUE; - uint16_t bytesread; + uint32_t bytesread; /* RAM Address Initialization */ RamAddress = (uint32_t) &RAM_Buf; diff --git a/Projects/STM322xG_EVAL/Applications/USB_Host/MSC_RTOS/Src/file_operations.c b/Projects/STM322xG_EVAL/Applications/USB_Host/MSC_RTOS/Src/file_operations.c index 83b0aed7..6f81b931 100644 --- a/Projects/STM322xG_EVAL/Applications/USB_Host/MSC_RTOS/Src/file_operations.c +++ b/Projects/STM322xG_EVAL/Applications/USB_Host/MSC_RTOS/Src/file_operations.c @@ -40,7 +40,7 @@ uint8_t wtext[] = "USB Host Library : Mass Storage Example"; */ void MSC_File_Operations(void) { - uint16_t bytesread; + uint32_t bytesread; LCD_UsrLog("INFO : FatFs Initialized \n"); diff --git a/Projects/STM322xG_EVAL/Applications/USB_Host/MSC_Standalone/Src/file_operations.c b/Projects/STM322xG_EVAL/Applications/USB_Host/MSC_Standalone/Src/file_operations.c index 284cf2cc..c95b814e 100644 --- a/Projects/STM322xG_EVAL/Applications/USB_Host/MSC_Standalone/Src/file_operations.c +++ b/Projects/STM322xG_EVAL/Applications/USB_Host/MSC_Standalone/Src/file_operations.c @@ -40,7 +40,7 @@ uint8_t wtext[] = "USB Host Library : Mass Storage Example"; */ void MSC_File_Operations(void) { - uint16_t bytesread; + uint32_t bytesread; LCD_UsrLog("INFO : FatFs Initialized \n");