Explorar o código

telnet: validate `ftp server_port` command arg

Sergey Alirzaev %!s(int64=4) %!d(string=hai) anos
pai
achega
d4d5760024
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      modules/cli/CLI_Commands.c

+ 1 - 1
modules/cli/CLI_Commands.c

@@ -3132,7 +3132,7 @@ static portBASE_TYPE prvTaskFTPCommand(cli_state_t *cli_state, int8_t *pcWriteBu
             ;
             u16_t server_port_old = sSettings.sFTPUpdate.server_port;
             int temp = atoi(str);
-            if (temp < 0 || temp > 65535) {
+            if (temp < 1 || temp > 65535) {
                 strcpy((char *)pcWriteBuffer, (const char *)pcInvalidCommand);
                 return pdFALSE;
             } else {