AnsweredAssumed Answered

Bug in MQX 4.1.1. ftpsrv_size

Question asked by CorderBollie on Nov 17, 2014
Latest reply on Nov 18, 2014 by Karel Mozny

Hello. I found a bug in function ftpsrv_size (MQX 4.1.1) around line 443..449

   fp = fopen(full_path,"r");
    _mem_free(full_path);
    if (fp == NULL)
    {
        ftpsrv_send_msg(session, ftpsrvmsg_no_file);
        return(FTPSRV_ERROR);
    }

 

should be

 

   fp = fopen(full_path,"r");
    _mem_free(full_path);
    if (fp == NULL)
    {
        session->message = (char*) ftpsrvmsg_no_file;
        return(FTPSRV_ERROR);
    }

 

Without that change the ftp server sends a wrong response to the client if the file does not exist.

Outcomes