Browse Source

telnet: validate `ftp server_port` command arg

Sergey Alirzaev 4 years ago
parent
commit
d4d5760024
1 changed files with 1 additions and 1 deletions
  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;
             u16_t server_port_old = sSettings.sFTPUpdate.server_port;
             int temp = atoi(str);
             int temp = atoi(str);
-            if (temp < 0 || temp > 65535) {
+            if (temp < 1 || temp > 65535) {
                 strcpy((char *)pcWriteBuffer, (const char *)pcInvalidCommand);
                 strcpy((char *)pcWriteBuffer, (const char *)pcInvalidCommand);
                 return pdFALSE;
                 return pdFALSE;
             } else {
             } else {