Bug in ftpsrv_help

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Bug in ftpsrv_help

811件の閲覧回数
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 返信

718件の閲覧回数
karelm_
Contributor IV

Hi,

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

Best regards,

Kare

0 件の賞賛
返信