FreeRTOS+TCP: Crash in FTP server if transfer socket cannot be created

Version: FreeRTOS+TCP distributed as part of FreeRTOS v10.2.1 File: FreeRTOSFTPserver.c, file version v2.03 In function prvTransferConnect(), if the socket cannot be created the return value xResult is set to an error code. However, the return value from prvTransferConnect() is treated as boolean by all callers of that function. This results in a NULL pointer dereference when pxClient->xTransferSocket is used later on. Example: in the handling of ECMD_PASV in prvProcessCommand(). Fix: Function prvTransferConnect(), line 901: Change -pdFREERTOS_ERRNO_ENOMEM to pdFALSE.

FreeRTOS+TCP: Crash in FTP server if transfer socket cannot be created

John, free beers for you! Thank you very much for noticing this, and taking the efffort to report it. I will change it and try to get it updated in the repo. Just to make sure, I will attach my latest versions of the FAT library and the servers:
  • FreeRTOS-Plus-FAT2july_2019.7z
  • FreeRTOSFTPHTTPservers2july2019
These are a official releases. The server code is just as a demo of how to use the lirbaries. Correction, should have been: “These are non-official releases”

FreeRTOS+TCP: Crash in FTP server if transfer socket cannot be created

I wrote:
These are a official releases.
Correction, that should be “These are non-official releases”. FreeRTOS_FTP_server. in te 7zip file already contains the change that you propose: ~~~ – xResult = -pdFREERTOSERRNOENOMEM; + xResult = pdFALSE; ~~~