STM32CubeF7 icon indicating copy to clipboard operation
STM32CubeF7 copied to clipboard

HTTP IAP bug

Open khevessy opened this issue 2 years ago • 2 comments

I think there is a potential bug in the HTTP IAP example. In the web server, there this code:https://github.com/STMicroelectronics/STM32CubeF7/blob/f8bda023e34ce9935cb4efb9d1c299860137b6f3/Projects/STM32756G_EVAL/Applications/LwIP/LwIP_IAP/Src/httpserver.c#L232-L269 and https://github.com/STMicroelectronics/STM32CubeF7/blob/f8bda023e34ce9935cb4efb9d1c299860137b6f3/Projects/STM32F769I_EVAL/Applications/LwIP/LwIP_IAP/Src/httpserver.c#L232-L269 which is used for handling GET request. POST requests are handled in else if() clause on lines 272 and 308. However, when sending of the binary is already happening, this can cause problem when the binary will contain string GET / and it will be just at the beginning of the data packet (it happened to me). Then we will skip this one packet and won't write the data at all. My proposal for solution would be either add a check for which page are we on to the line 232, or move the clause that is handling the raw data (from line 308) to the beginning of the if.

Similar problem is also in the STM32CubeF4 project, I'll make separate issue there as the code is a little bit different.

khevessy avatar Jul 13 '22 08:07 khevessy

Hi @Irisbus,

Would you please give us more details about how you got this issue ? Did you detected it at runtime or is it just an observation ?

With regards,

ASELSTM avatar Aug 16 '22 11:08 ASELSTM

Hi,

yes, we detected it runtime (in an application based on this example). Maybe there is a very slim chance of this occurring but it can happen.

Regards, Karel

khevessy avatar Aug 16 '22 11:08 khevessy