Bug in ftpsrv_help

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Bug in ftpsrv_help

357 次查看
CorderBollie
Contributor II

Hello.

In MQX 4.1.1. there is a bug in function ftpsrv_help (ftpsrv_cmd.c).

If one adds custom FTP commands so that the overall number of FTP commands is no longer a multiple of 4, then the remotehelp command will no longer work correctly.

I identified line 255 in ftpsrv_help being the problem where a closing "\r\n" is appended to the buffer.

However the counter 'space' is not decremented by two and the closing "\r\n" is not send.

The effect of this is that you are not able to enter any command in a ftp client when you call 'remotehelp'.

I fixed this like:

if (n)
{
    space -= snprintf(buffer+length, space, "\r\n");
}
/* Send command list from the buffer and set message to HELP end text */
send(session->control_sock, buffer, FTPSRV_BUF_SIZE-space, 0);

标签 (1)
标记 (2)
0 项奖励
1 回复

264 次查看
karelm_
Contributor IV

Hi,

Thank you for your effort. We already fixed this bug for next release of MQX.

Best regards,

Kare

0 项奖励