|  | @@ -2883,33 +2883,29 @@ static portBASE_TYPE prvTaskFTPCommand(cli_state_t *cli_state, int8_t *pcWriteBu
 | 
	
		
			
				|  |  |          return pdFALSE;
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -    /* Obtain the parameter string. */
 | 
	
		
			
				|  |  | +    /* Obtain the subcommand */
 | 
	
		
			
				|  |  |      pcParameterString = (int8_t *)FreeRTOS_CLIGetParameter
 | 
	
		
			
				|  |  |          (
 | 
	
		
			
				|  |  |              pcCommandString,        /* The command string itself. */
 | 
	
		
			
				|  |  |              xParameterNumber,       /* Return the next parameter. */
 | 
	
		
			
				|  |  |              &xParameterStringLength /* Store the parameter string length. */
 | 
	
		
			
				|  |  |          );
 | 
	
		
			
				|  |  | -    for (i = 0; i < ARG_FTP_ALL; i ++) {
 | 
	
		
			
				|  |  | +    for (i = 0; i < ARG_FTP_ALL; i++) {
 | 
	
		
			
				|  |  |          if (strncmp((const char *)pcParameterString, ftp_args_list[i], strlen(ftp_args_list[i])) == 0
 | 
	
		
			
				|  |  |              && xParameterStringLength == strlen(ftp_args_list[i])) {
 | 
	
		
			
				|  |  |              break;
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  | -    xParameterNumber ++;
 | 
	
		
			
				|  |  | +    xParameterNumber++;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -    /* Obtain the parameter string. */
 | 
	
		
			
				|  |  | -    pcParameterString = ( int8_t * ) FreeRTOS_CLIGetParameter
 | 
	
		
			
				|  |  | +    /* Obtain the subcommand parameter */
 | 
	
		
			
				|  |  | +    pcParameterString = (int8_t *)FreeRTOS_CLIGetParameter
 | 
	
		
			
				|  |  |          (
 | 
	
		
			
				|  |  |              pcCommandString,        /* The command string itself. */
 | 
	
		
			
				|  |  |              xParameterNumber,       /* Return the next parameter. */
 | 
	
		
			
				|  |  |              &xParameterStringLength /* Store the parameter string length. */
 | 
	
		
			
				|  |  |          );
 | 
	
		
			
				|  |  |      memset(str, 0, sizeof(str));
 | 
	
		
			
				|  |  | -    if (xParameterStringLength > 3) {
 | 
	
		
			
				|  |  | -        strcpy((char *)pcWriteBuffer, (const char *)pcInvalidCommand);
 | 
	
		
			
				|  |  | -        return pdFALSE;
 | 
	
		
			
				|  |  | -    }
 | 
	
		
			
				|  |  |      strncat(str, (const char *) pcParameterString, xParameterStringLength);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      switch (i) {
 | 
	
	
		
			
				|  | @@ -2939,8 +2935,7 @@ static portBASE_TYPE prvTaskFTPCommand(cli_state_t *cli_state, int8_t *pcWriteBu
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              break;
 | 
	
		
			
				|  |  |          case ARG_FTP_remote_path: {
 | 
	
		
			
				|  |  | -            unsigned len = strlen(str);
 | 
	
		
			
				|  |  | -            if (len < 1 || len >= sizeof(sSettings.sFTPUpdate.remote_path)) {
 | 
	
		
			
				|  |  | +            if (xParameterStringLength < 1 || xParameterStringLength >= sizeof(sSettings.sFTPUpdate.remote_path)) {
 | 
	
		
			
				|  |  |                  strcpy((char *)pcWriteBuffer, (const char *)pcInvalidCommand);
 | 
	
		
			
				|  |  |                  return pdFALSE;
 | 
	
		
			
				|  |  |              } else {
 | 
	
	
		
			
				|  | @@ -2949,8 +2944,7 @@ static portBASE_TYPE prvTaskFTPCommand(cli_state_t *cli_state, int8_t *pcWriteBu
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              break; }
 | 
	
		
			
				|  |  |          case ARG_FTP_user: {
 | 
	
		
			
				|  |  | -            unsigned len = strlen(str);
 | 
	
		
			
				|  |  | -            if (len < 1 || len >= sizeof(sSettings.sFTPUpdate.user)) {
 | 
	
		
			
				|  |  | +            if (xParameterStringLength < 1 || xParameterStringLength >= sizeof(sSettings.sFTPUpdate.user)) {
 | 
	
		
			
				|  |  |                  strcpy((char *)pcWriteBuffer, (const char *)pcInvalidCommand);
 | 
	
		
			
				|  |  |                  return pdFALSE;
 | 
	
		
			
				|  |  |              } else {
 | 
	
	
		
			
				|  | @@ -2959,8 +2953,7 @@ static portBASE_TYPE prvTaskFTPCommand(cli_state_t *cli_state, int8_t *pcWriteBu
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              break; }
 | 
	
		
			
				|  |  |          case ARG_FTP_pass: {
 | 
	
		
			
				|  |  | -            unsigned len = strlen(str);
 | 
	
		
			
				|  |  | -            if (len < 1 || len >= sizeof(sSettings.sFTPUpdate.pass)) {
 | 
	
		
			
				|  |  | +            if (xParameterStringLength < 1 || xParameterStringLength >= sizeof(sSettings.sFTPUpdate.pass)) {
 | 
	
		
			
				|  |  |                  strcpy((char *)pcWriteBuffer, (const char *)pcInvalidCommand);
 | 
	
		
			
				|  |  |                  return pdFALSE;
 | 
	
		
			
				|  |  |              } else {
 |